Skip to content

Elvis339/threadsafe_zmq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thread-safe ZeroMQ

This implementation is based on Golang's zmqchan, all the credit should go the the author of zmqchan

This is just a tweaked implementation in Rust

Message Flow

                        +-------------------+
                        |     Client        |
                        +-------------------+
                                    |
                                    v
                            (Client Sends Message)
                                    |
+-----------------------------------v----------------------------------------+
|                          ChannelPair                                       |
|                                                                            |
|                           +--------------+                                 |
|                           |    z_sock    |                                 |
|                           | (ZeroMQ SOCK)|                                 |
|                           +--------------+                                 |
|                                   |                                        |
|                                   v                                        |
|                     (Message Forwarded to Channel)                         |
|                                   |                                        |
|                          +--------------+                                  |
|                          |   channel    |                                  |
|                          | (Crossbeam   |                                  |
|                          |   Channel)   |                                  |
|                          +--------------+                                  |
|                                   |                                        |
|                                   v                                        |
|                    (Message Consumed by `z_tx[IN]`)                        |
|                           +---------------+                                |
|                           |   z_tx[IN]    |                                |     
|                           | (PAIR Socket) |                                | 
|                           +---------------+                                |
|                                   |                                        |
|                                   |                                        |
|                       (Message Sent to `z_tx[OUT]`)                        |                        
|                                   |                                        |
|                                   v                                        | 
|                           +---------------+                                |
|                           |   z_tx[OUT]   |                                |
|                           | (PAIR Socket) |                                |
|                           +---------------+                                |
|                    (Message Passed to `z_sock`)                            |
|                                   |                                        |
|                                   |                                        |
|                    (Message Prepared for `z_sock`)                         |
|                                   v                                        |
|                           +--------------+                                 |
|                           |   z_sock     |                                 |
|                           | (Writable)   |                                 |
|                           +--------------+                                 |
|                                   |                                        |
|                    (Message Sent Back to Client)                           |
|                                   |                                        |
+----------------------------------------------------------------------------+
                                    |
                                    v
                        (Client Receives Response)
                                    |
                            +-------------------+
                            |      Client       |
                            +-------------------+

Releases

No releases published

Packages

No packages published

Languages