aare/examples/zmq_worker.cpp
Bechir Braham 68dcfca74e
Feature/reactivate python bindings (#74)
major changes:
- add python bindings for all c++ features except network_io
- changes to cross compile on windows,linux and macos
- fix bugs with cluster_finder
- use Dtype in Frame instead of bitdepth
- remove boost::program_options and replace with our implementation 
- add Transforms class that applies a sequence of functions (c++ or
python functions) on a Frame.
- remove frame reorder and flip from SubFile.cpp. use Transforms instead
- Test clusterFinder and Pedestal results in comparison with
slsDetectorCalibration

---------

Co-authored-by: Bechir <bechir.brahem420@gmail.com>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2024-07-04 11:51:48 +02:00

31 lines
869 B
C++

#include "aare.hpp"
#include "aare/examples/defs.hpp"
#include "zmq.h"
#include <cassert>
#include <fmt/core.h>
#include <string>
using namespace aare;
using namespace std;
int main() {
logger::set_verbosity(logger::DEBUG);
// 1. connect to ventilator and sink
ZmqWorker worker("tcp://127.0.0.1:4321", "tcp://127.0.0.1:4322");
while (true) {
// 2. receive Task from ventilator
Task *ventilator_task = worker.pull();
logger::info("Received Task, id=", ventilator_task->id, " data_size=", ventilator_task->data_size);
Task *sink_task = Task::init(nullptr, 0);
sink_task->id = ventilator_task->id;
sink_task->opcode = (size_t)Task::Operation::COUNT;
worker.push(sink_task);
Task::destroy(sink_task);
Task::destroy(ventilator_task);
}
// read the command line arguments
}