A1:
Yes, this is possible in ZeroMQ
or nanomsg
sort of tools
Both the ZeroMQ
and it's younger sister nanomsg
share the vision of
Scaleable ( which you did not emphasise yet )
Formal ( hard-wired formal behaviour )
Communication ( yes, it's about this )
Pattern ( that are wisely carved and ready to re-use and combine as needed )
This said, if you prefer to have just one socket-pattern on each "side", then you have to choose such a Formal Pattern, that would leave you all the freedom from any hard-wired behaviour, so as to meet your goal.
So, a) "...only one" is doable -- by a solo of zmq.PAIR
(which some parts of documentation flag as a still an experimental device) or NN.BUS
or a pair of PUSH/PULL
if you step back from allowing just a single one ( which in fact does eliminate all the cool powers of the sharing of the zmq.Context()
instantiated IO-thread(s) for re-using the low-level IO-engine. If you spend a few minutes with examples referred to below, you will soon realise, that the very opposite policy is quite common and beneficial to the design targets, when one uses more, even many, patterns in a system architecture.
The a) "...non-blocking" is doable, by stating proper directives zmq.NOBLOCK
for respective .send() / .recv()
functions and by using fast, non-blocking .poll()
loops in your application design architecture.
On b) "...without ... delay" is related to the very noted remark on application design architecture, as you may loose this just by relying on a poor selection and/or not possible tuning of the event-handler's internal timings and latency penalties. If you shape your design carefully, you might remain in a full control of the delay/latency your system will experience and not bacoming a victim of any framework's black-box event-loop, where you can nothing but wait for it's surprises on heavy system or traffic loads.
On c) "... X crash after a Y crashed" is doable on { ZeroMQ | nanomsg }-
grounds, by a carefull combination of non-blocking mode of all functions + by your design beeing able to handle exceptions in the situations it does not receive any POS_ACK
from the intended { local | remote }-
functionality. In this very respect, it is fair to state, that some of the Formal Communication Patters do not have this very flexibility, due to some sort of a mandatory internal behaviour, that is "hard wired" internally, so a due care is to be taken in selecting a proper FCP-archetype for each such still scaleable but fault-resilient role.
Q2:
No.
The best next step:
You might feel interested in other ZeroMQ
posts here and also do not miss the link to the book, referred there >>>