[bind10-dev] Messaging API questions
Michael Graff
mgraff at isc.org
Thu Aug 13 17:59:55 UTC 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I've started on a Wiki page for this
(http://bind10.isc.org/wiki/InterModuleCommunication) and have some
pre-design design questions. :)
First, messages being sent are pretty easily handled; they can be sent
immediately using standard blocking or non-blocking I/O. Incoming
messages may need special care for certain applications.
If a server is doing nothing but waiting for messages (such as a
statistics gathering or logger module) then there is little issue; they
will just block waiting for a message. However, I suspect most
consumers will want to do other things as well, like serve DNS data.
The two usage models I can come up with here are pretty standard ones:
the messaging API returns a descriptor that can be added to the usual
event processing loop (libev in our case) and when I/O is available, a
call into the messaging API is made to handle it. This is all pretty
standard and understood.
Now, my concern is what happens next? Should the message API return and
say "here's your message" or should there be a message callback? I am
generally fond of callbacks, but that was in C. Is there a better way
in C++? Does the language matter? Will a callback complicate Python or
Ruby consumers of this API? Or even C++ ones?
Not using a callback means that the thing doing the I/O needs to
implement the same functionality, which seems simple enough. But
callbacks might be easier to implement and not require each application
to "roll its own processing loop" as much.
Thoughts?
- --Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkqEVJsACgkQ+NNi0s9NRJ3CFQCcDifa8ggOevANngu2JjYkTWyn
CS8An1A82FYBaxCZ0147cKGPqXrs8NzB
=Pnis
-----END PGP SIGNATURE-----
More information about the bind10-dev
mailing list