Esteve Fernandez wrote:
...
Well, actually I'm the txAMQP dude :-) If you feel like implementing a Thrift
+ AMQP library, (which I still plan to do but joining efforts would be great)
here's what I did:
Excellent. See you at LShift on the 3rd.
I did the FreeBSD port update of devel/thrift yesterday AM London, it's
been 36 hours now, no response from the ports guys or maintainer so I
may just go ahead and check it in.
- Implement AMQP using an asynchronous library, in this case ASIO is the
perfect candidate, as it will be part of C++0x
I have so far only skimmed the ASIO docs. I couldn't immediately map it
back to non-blocking I/O with select(), I daresay that penny will drop
once I read code.
It seems to be geared up to support a few varying I/O dispatch models,
including POSIX async I/O. However my experiments many years ago
suggested that AIO wasn't always the best solution, and can be let down
by vendor implementations of AIO.
- Implement client and server asynchronous transports for Thrift (using ASIO).
Have a look at the standard framed transport (TFramedTransport).
I have yet to sit down and re-read the Apache Thrift snapshot with a
clear head / appropriate cognitive gloss.
TFramedTransport seems to be a requirement for TNonblockingServer anyway.
Analogous to XORP XRL's SCTP frame encapsulation -- reassembly of
messages is required with buffering 'cuz TCP does not preserve message
boundaries.
XRL code currently sucks in that it is not guaranteed to be safe for
strong-alignment architectures.
My only question (from risk management) would be: is ASIO tight?
I realize this is unrelated, but: I tried the Bopst Graph Library (BGL)
and our own Spt class for Dijkstra substantially outperformed it. Then
again our Spt is specialized for yielding collections of abstract route
table manipulation commands. BGL is heavyweight on the theory, and very
general purpose. It could be GCC to blame, I suppose, but I didn't look
under the hood.
- Make the Thrift compiler generate client functions which return Deferreds
(futures) instead of real values. Also, you'll have to add some code in the
server for supporting asynchronous handler functions. Given that there will be
support for futures in C++0x, you won't need to roll your own version.
I still need to get my head around the Futures concept. Are there more
general pointers?
- Glue them together using a TMemoryBuffer, a special transport (e.g.
TwistedAMQPTransport in txAMQP) and the "reply-to" property in AMQP
Hope that helped, feel free to ask any details if you need more info.
Excellent hints. Thank you.
I couldn't find any useful books on CORBA in Central London yesterday
(Blackwells x 2, Borders, Foyles, Skoob). Dodo.
Who is writing the Thrift book? :-)
cheers,
BMS