[nanomsg] The nanoconfig preview

  • From: Paul Colomiets <paul@xxxxxxxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Fri, 4 Oct 2013 13:49:44 +0300

Hi,

I've just published first version of nanoconfig.

https://github.com/tailhook/nanoconfig

It basically works. There is a high chance of hitting bug #114, will
try to fix it soon.

We should eventually recommend all language bindings to support it out
of the box. The C API is just as simple as:

nc_configure(sock, "nanoconfig://topology");
nc_close(sock);

The `nc_close` replaces `nn_close` because the real processing is done
inside separate thread, so the socket must be closed inside that
thread too.

The exact name service to use is configured by environment:

NN_CONFIG_SERVICE=ipc:///run/nnconfig.sock
NN_CONFIG_UPDATES=ipc:///run/nnupdates.sock

For language bindings I'd recommend to add `configure` method to the
socket, that automatically switches destructor to use `nc_close`
instead `nn_close`. I'm also thinking about nicer API like:

sock.config("topology", {"role": "client", "pid": getpid()})
=> nn_configure ("nanoconfig://topology?role=client&pid=1234")

Thoughts?

I'd like project to be moved to nanomsg organization, to encourage
more people to experiment with it.

-- 
Paul

Other related posts: