zeromq / zmq.rs

A native implementation of ØMQ in Rust
https://crates.io/crates/zeromq
MIT License
1.16k stars 101 forks source link

Implement CLIENT and SERVER Socket types #93

Open andrewdavidmackenzie opened 4 years ago

andrewdavidmackenzie commented 4 years ago

I am interested in using the Client-Server pattern (https://zeromq.org/socket-api/) in my rust project, so just wanted to register that interest here and add these socket types to the list of issues for implementing others.

Alexei-Kornienko commented 4 years ago

@andrewdavidmackenzie there are already some working examples that you can play with - https://github.com/zeromq/zmq.rs/tree/master/examples

Could you please describe your usecase in more details so I would understand better what exactly do you need

andrewdavidmackenzie commented 4 years ago

Hi, I want a single central server that gets "jobs" submitted from clients, the channel back to the client has an ID that the server stores in the job and uses to send updates to that client as the job is processed (seconds or minutes to complete).

The server is multi threaded/async and able to process multiple jobs in parallel, so it needs a unique channel (via ID?) back to the client that submitted it.

It needs to be able to accept new jobs at any time, from any new client.

With REQ/REP (I have implemented) there is a pair of "channels" so server can just reply to the one client AFAIK.

When reading the docs, it sounded like the experimental client-server model fitted those needs.

Thanks for asking