[nanomsg] Re: Asynchronous (raw) sockets in nanomsg

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Sat, 16 Nov 2013 19:53:12 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 16/11/13 17:46, Schmurfy wrote:
> I definetely like the idea of having the existing constructs
> supporting async use, I used both zeromq and crossroads in
> different personal projects but in the idea I only used XREQ/XREP
> since I always had multiple req/rep in parallel. As for the
> request_id the user should have full control over it but why not 
> add a new function in the library to generate ids in sequence ?
> 
> int nn_init_sequence(int *seq); int nn_next_id(const int *seq);

Another option would be to use user-provided IDs. Specifically void
pointers would be nice as it allows to associate the request with
arbitrary user-defined object.

nn_req_send (int s, void *id, void *buf, size_t len, int flags);

> Like paul I keep implementing and reimplementing the same stuff
> again and again, having that builting would really be a nice
> thing.

Yes. It looks like the parallel requests happen in more than 50% of
use cases, so implementing it in the library makes sense.

Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSh78YAAoJENTpVjxCNN9Y1JQH/R+s5fEfnAEduW73L7QqUOLK
4+kaOpBoomGLc/DsLt+ZPMqZThZKK3gI6r+1L4M7Bt7IONDs+wo1gy9eqmpnoL6J
0hO8h/gN23pFcvBwiA6Udf6c7lAk8QGF4tLycrxVcCP8yBIPBDLys18rGqgpbcHu
F3AKcKiCCChFg+BNXO7M4v0NcegS1tcvHnAAVqpFh3si6GHI9x80atlwuM+84SeI
tb4K+YiOZHNwmgCXNu9mYMMLXHjD1f008vEHHsnowpOIKISI3q24mooE6YJq6bWG
7BDoEp7Y+Vq2iE283CdtIkGim9nEBbA87mXBz/QhqHNVqTVihB3EG/UVchiGyEE=
=sqNJ
-----END PGP SIGNATURE-----

Other related posts: