Skip to content

Commit

Permalink
Give HandleRxSocket an extra argument so can use context_threads
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesOHeaDLS committed Aug 9, 2024
1 parent 3113d77 commit 4cf55c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cpp/data/eigerfan/include/EigerFan.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class EigerFan {
EigerFan(EigerFanConfig config_);
virtual ~EigerFan();
void run();
void HandleRxSocket(std::string& endpoint);
void HandleRxSocket(std::string& endpoint, int num_zmq_context_threads);
void Stop();
void SetNumberOfConsumers(int number);

Expand Down
6 changes: 3 additions & 3 deletions cpp/data/eigerfan/src/EigerFan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void EigerFan::run() {
// Spawn rx thread
LOG4CXX_INFO(log, "Spawning rx thread");
this->rx_thread_ = boost::shared_ptr<boost::thread>(
new boost::thread(boost::bind(&EigerFan::HandleRxSocket, this, streamConnectionAddress))
new boost::thread(boost::bind(&EigerFan::HandleRxSocket, this, streamConnectionAddress, config.num_zmq_context_threads))
);

while (state != WAITING_STREAM) {
Expand Down Expand Up @@ -360,8 +360,8 @@ void EigerFan::run() {
/**
* Connect broker to detector and handle the messages it produces
*/
void EigerFan::HandleRxSocket(std::string& endpoint) {
zmq::context_t inproc_context(8);
void EigerFan::HandleRxSocket(std::string& endpoint, int num_zmq_context_threads) {
zmq::context_t inproc_context(num_zmq_context_threads);
zmq::socket_t rx_socket(inproc_context, ZMQ_PULL);
rx_socket.setsockopt(ZMQ_RCVHWM, &RECEIVE_HWM, sizeof(RECEIVE_HWM));
rx_socket.bind(BROKER_INPROC_ENDPOINT.c_str());
Expand Down

0 comments on commit 4cf55c4

Please sign in to comment.