update readme with libevent handler details
This commit is contained in:
parent
bbfcf76f39
commit
89799f54e4
20
README.md
20
README.md
|
|
@ -333,8 +333,8 @@ class MyTcpHandler : public AMQP::TcpHandler
|
|||
````
|
||||
|
||||
The "monitor()" method can be used to integrate the AMQP filedescriptors in your
|
||||
application's event loop. For some popular event loops (libev), we have already
|
||||
added example handler objects (see the next section for that).
|
||||
application's event loop. For some popular event loops (libev, libevent), we have
|
||||
already added example handler objects (see the next section for that).
|
||||
|
||||
Using the TCP module of the AMQP-CPP library is easier than using the
|
||||
raw AMQP::Connection and AMQP::Channel objects, because you do not have to
|
||||
|
|
@ -373,9 +373,9 @@ call), or if you use an existing library for it (like libevent, libev or libuv),
|
|||
you can implement the "monitor()" method to watch the file descriptors and
|
||||
hand over control back to AMQP-CPP when one of the sockets become active.
|
||||
|
||||
For libev users, we have even implemented an example implementation, so that
|
||||
you do not even have to do this. Instead of implementing the monitor() method
|
||||
yourself, you can use the AMQP::LibEvHandler class instead:
|
||||
For libev and libevent users, we have even implemented an example implementation,
|
||||
so that you do not even have to do this. Instead of implementing the monitor() method
|
||||
yourself, you can use the AMQP::LibEvHandler or AMQP:LibEventHandler classes instead:
|
||||
|
||||
````c++
|
||||
#include <ev.h>
|
||||
|
|
@ -414,15 +414,15 @@ int main()
|
|||
}
|
||||
````
|
||||
|
||||
The AMQP::LibEvHandler class is an extended AMQP::TcpHandler class, with an
|
||||
implementation of the monitor() method that simply adds the filedescriptor to the
|
||||
libev event loop. If you use this class however, it is recommended not to
|
||||
The AMQP::LibEvHandler and AMQP::LibEventHandler classes are extended AMQP::TcpHandler
|
||||
classes, with an implementation of the monitor() method that simply adds the
|
||||
filedescriptor to the event loop. If you use this class however, it is recommended not to
|
||||
instantiate it directly (like we did in the example), but to create your own
|
||||
"MyHandler" class that extends from it, and in which you also implement the
|
||||
onError() method to report possible connection errors to your end users.
|
||||
|
||||
Currently, we have only added such an example TcpHandler implementation for libev.
|
||||
For other event loops (like libevent, libev and boost asio) we do not yet have
|
||||
Currently, we have only added such an example TcpHandler implementation for libev and
|
||||
libevent. For other event loops (like libuv and boost asio) we do not yet have
|
||||
such examples.
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue