Skip to content

Encapsulate response-waiting-and-matching logic #16

Description

@sarahzrf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions