[zeromq-dev] Cleaning-up context creation API

Aurélien Vallée vallee.aurelien at gmail.com
Thu Feb 16 01:41:55 CET 2012


Just my 2 cents:
get/set are easy to remember, while peek/poke are... kind of weird

On Thu, Feb 16, 2012 at 12:03 AM, Andrew Hume <andrew at research.att.com>wrote:

> works for me.
>
> On Feb 15, 2012, at 3:57 PM, Pieter Hintjens wrote:
>
> Hi all,
>
> I'd like to canvas opinion for some cleanup of the ctx creation API.
> This would be a backwards compatible change in accordance with
> http://www.zeromq.org/docs:policies#toc2.
>
> There are several faults with the current context API:
>
> * It is inconsistent with the rest of the API, e.g. zmq_init for a new
> context vs. zmq_msg_init vs. zmq_socket for a new socket.
> * It still has that iothreads option in zmq_init, which IMO should
> have gone a long time ago.
> * It is not extensible, so we are seeing new experiments like
> zmq_init_thread_safe().
>
> My proposal is to make a new consistent API for contexts:
>
> * zmq_ctx_init and zmq_ctx_term
> * zmq_ctx_peek and zmq_ctx_poke to get/set options
> * explicit option settings for ZMQ_IOTHREADS and ZMQ_THREADSAFE
>
> And internally this would create the context lazily, only when the
> first socket is created (so the IOTHREADS can be applied then).
>
> There is a separate discussion about changing the functions for
> get/set message options. Peek/poke are short. getctxopt/setctxopt are
> messy wrt the other ctx functions.
>
> -Pieter
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
>
> ------------------
> Andrew Hume  (best -> Telework) +1 623-551-2845
> andrew at research.att.com  (Work) +1 973-236-2014
> AT&T Labs - Research; member of USENIX and LOPSA
>
>
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>


-- 
Aurélien Vallée
+33 6 47 41 70 37
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120216/19b1bbf8/attachment.htm>


More information about the zeromq-dev mailing list