-
Notifications
You must be signed in to change notification settings - Fork 102
Design
Fantix King edited this page Jul 9, 2014
·
5 revisions
The design below is outdated.
As shown in the diagram, each box is a Rust Task
, and user will only have access to the "interface" - the red box SocketBase
, which will normally be implemented as for example REQ
socket.
The arrows are Rust Channel
s - the zero-copy communication tool between Task
s. It is very similar to the idea of Pipe
in libzmq. Because Rust cannot select over socket events but only channels, I had to split the socket-related jobs into separate Task
s, and control everything in a central InnerSocketBase
task, where all incoming messages are selected and handled in one place.
Let's take socket.bind()
for example.