Skip to content
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

Encapsulate response-waiting-and-matching logic #16

Open
sarahzrf opened this issue Aug 5, 2016 · 0 comments
Open

Encapsulate response-waiting-and-matching logic #16

sarahzrf opened this issue Aug 5, 2016 · 0 comments

Comments

@sarahzrf
Copy link
Contributor

sarahzrf commented Aug 5, 2016

In many cases, it's less than ideal to use ØMQ's synchronous sockets, but the communication being done is still in one-reply-to-one-request form. ECell's logic for handling these cases is spread out a bit through the code (mostly in Calling, Management, and line_handlers.rb), and is the source of some failures to be DRY.

I think it'd be a good idea to write a new class (or maybe just add methods to Line) that abstract over this use case. Interface-wise, it'd provide a method which you call with the message to send that then synchronously returns the response, so that rep = line << req; rep = rep.wait can be replaced with rep = something.the_method(req).

If done correctly, I think this rid of the need for the hardcoding in Constants::RETURNS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant