-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
akka-zeromq: Add support for the rest of the socket configurations
While at it, add support for accessing values of 'ZMQ_FD' and 'ZMQ_RCVMORE' socket options. Note that accessing 'ZMQ_HWM' is not currently supported as the implementation of the JZMQ like API is missing an accessor method. This will be fixed in the next version of the ZeroMQ Scala Binding. Also, remove some of the trailing whitespaces. Signed-off-by: Karim Osman <karim@iki.fi>
- Loading branch information
Showing
2 changed files
with
139 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7fa972e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't requiring messages for the config opening the door to get unintentional errors.
For example the HWM must be set before connecting or binding the socket. when i then have code like this:
There are no guarantees that the message HWM will actually be processed before the Bind message unless you put the throughput of the dispatcher to 1.
I also have a question regarding the polling. Because there is a pollReceiveTimeout set the zeromq poller will block the actor for that amount of time and then iterate once to block again.
Having that poller in the same actor instead of in a future or a child actor doesn't that lead to messages you send to the socket actor are only processed once per poll-cycle (and with the amount of messages being processed per cycle not being larger than the throughput setting of the dispatcher) ?
7fa972e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The “no guarantees” sentence is not correct: Akka does not guarantee delivery of any one message, but in practice it cannot fail within the same JVM (if you are sensible enough to configure the JVM to exit upon OutOfMemoryError).
BUT: messages are never re-ordered, and this does not depend on the throughput setting!
7fa972e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What? order of messages are retained on a per-sender basis
7fa972e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, HWM will be processed before Bind in your code.