-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inheriting an actor #239
Comments
Is this repo no longer active? |
I'm not a contributor to this repository, but a constructor that is an infinite loop seems like an anti pattern. In this particular case you'll only ever have one worker running at a time because construction of the second worker only completes when the first worker terminates. Edit: On closer inspection it looks like this code is half baked, you're using a non-existent |
Sorry for for the confusion, there were two typos in the original example above, which I have edited. Where the infinite while loop was should have been the In either event, a solution to my problem based upon this zmqpp library has been abandoned as this repo seems to be completely dead. I have instead gone back to using CZMQ instead, I was just hoping that this implementation would provide a little more OO like flavor to the zmq actor pattern. I'd still be open to suggestions/criticism on this potential solution for future knowledge. |
No worries! I pulled down your code, built it, and executed and it works the way I'd expect -- after declaring the As for whether deriving from You asked about whether a As for whether there is a simpler way to do what you're trying to do, it's hard to say without more meat to the example. If you're just trying to run some simple calculations in parallel and capture a result after stopping then using actors to do that is reasonable. You could consider a thread pool if You mentioned thread-safety concerns due to access of members in the |
I have tried to create a derived class from a
zmqpp::actor
to test embedding the routines into a more OO application. Here is s simple test example of what I was thinking was possible.I was wondering if this is ok to do this with these actors or if there was some kind of underlying issue with this approach. If there is a better / simpler way to accomplish the same results, I would be curious to hear any suggestions. Also, am I overlooking where a zmqpp::context is required here somewhere or is that only necessary if the ActorRoutine needs to create a zmqpp::socket object?
I understand that there are thread safety concerns with accessing the member variables of this simplistic Worker inside the ActorRoutine here, my question is more related to the zmqpp usage.
The text was updated successfully, but these errors were encountered: