threadsafe_zmq

Crates.iothreadsafe_zmq
lib.rsthreadsafe_zmq
version1.0.1
sourcesrc
created_at2024-10-06 15:47:31.718327
updated_at2024-10-08 08:49:19.350342
descriptionThreadsafe zeromq
homepage
repositoryhttps://github.com/Elvis339/threadsafe_zmq
max_upload_size
id1399162
size26,340
Elvis (Elvis339)

documentation

README

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       |
                            +-------------------+
Commit count: 20

cargo fmt