∅MQD, a ∅MQ wrapper for D

Justin Whear justin at economicmodeling.com
Fri Jan 24 11:20:26 PST 2014


On Fri, 24 Jan 2014 19:11:56 +0000, Lars T. Kyllingstad wrote:

> On Friday, 24 January 2014 at 18:59:54 UTC, Justin Whear wrote:
>> Nicely done.  It looks like you haven't wrapped the poll functionality
>> at all, something that I use in most of my 0MQ programs.
> 
> Thanks!  I'm glad that you mention zmq_poll(); I've been wondering how
> to deal with that.  It's slightly more low-level than the other
> functions, since it also deals with standard OS file descriptors, and
> I'd rather not expose OS-level stuff in ∅MQD more than strictly
> necessary.  Do you ever use that functionality, or do you just poll ∅MQ
> sockets?
> 
> Lars

I think I've mixed a file descriptor in with sockets once, but not in 
current production code.  A quick thought: you might template the poll 
wrapper so that the user could pass a mix of Socket and int (or whatever 
the proper name is for the file descriptor type per OS).  Inside, you set 
the appropriate property on each zmq_pollitem_t structure based on the 
argument type.

Now that I think of it, you also need to find a scheme for indicating 
which events you want to listen for.  Which means either a simple pairing 
type (socket, event mask) or a getopt-style interface.


More information about the Digitalmars-d-announce mailing list