37 virtual void Init(
int fd,
unsigned workerN);
54 std::unique_ptr<TSocket>
fS;
std::pair< unsigned, std::unique_ptr< TBufferFile > > MPCodeBufPair
An std::pair that wraps the code and optional object contained in a message.
unsigned long long ULong64_t
This class works in conjuction with TMPClient, reacting to messages received from it as specified by ...
void SendError(const std::string &errmsg, unsigned int code=MPCode::kError)
Error sender.
unsigned GetNWorker() const
std::string fId
identifier string in the form W<nwrk>|P<proc id>
ULong64_t fMaxNEntries
the maximum number of entries to be processed by this worker
ULong64_t fProcessedEntries
the number of entries processed by this worker so far
unsigned fNWorker
the ordinal number of this worker (0 to nWorkers-1)
virtual void HandleInput(MPCodeBufPair &msg)
Handle a message with an EMPCode.
pid_t fPid
the PID of the process in which this worker is running
std::unique_ptr< TSocket > fS
This worker's socket. The unique_ptr makes sure resources are released.
TMPWorker(unsigned nWorkers, ULong64_t maxEntries)
virtual void Init(int fd, unsigned workerN)
This method is called by children processes right after forking.
TMPWorker(const TMPWorker &)=delete
unsigned fNWorkers
the number of workers spawned
TMPWorker & operator=(const TMPWorker &)=delete