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
|
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
|
application's event loop. For some popular event loops (libev, libevent), we have
|
||||||
added example handler objects (see the next section for that).
|
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
|
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
|
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
|
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.
|
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
|
For libev and libevent users, we have even implemented an example implementation,
|
||||||
you do not even have to do this. Instead of implementing the monitor() method
|
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:
|
yourself, you can use the AMQP::LibEvHandler or AMQP:LibEventHandler classes instead:
|
||||||
|
|
||||||
````c++
|
````c++
|
||||||
#include <ev.h>
|
#include <ev.h>
|
||||||
|
|
@ -414,15 +414,15 @@ int main()
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
|
||||||
The AMQP::LibEvHandler class is an extended AMQP::TcpHandler class, with an
|
The AMQP::LibEvHandler and AMQP::LibEventHandler classes are extended AMQP::TcpHandler
|
||||||
implementation of the monitor() method that simply adds the filedescriptor to the
|
classes, with an implementation of the monitor() method that simply adds the
|
||||||
libev event loop. If you use this class however, it is recommended not to
|
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
|
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
|
"MyHandler" class that extends from it, and in which you also implement the
|
||||||
onError() method to report possible connection errors to your end users.
|
onError() method to report possible connection errors to your end users.
|
||||||
|
|
||||||
Currently, we have only added such an example TcpHandler implementation for libev.
|
Currently, we have only added such an example TcpHandler implementation for libev and
|
||||||
For other event loops (like libevent, libev and boost asio) we do not yet have
|
libevent. For other event loops (like libuv and boost asio) we do not yet have
|
||||||
such examples.
|
such examples.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue