![]() |
MySQL 8.0.43
Source Code Documentation
|
Main event registration and dispatch engine
More...
#include <http_common.h>
Classes | |
| struct | impl |
Public Types | |
| using | SocketHandle = EventBaseSocket |
| using | CallbackEvent = void(*)(SocketHandle, short, void *) |
Public Member Functions | |
| EventBase () | |
| EventBase (EventBase &&event) | |
| ~EventBase () | |
| bool | once (const SocketHandle fd, const EventFlags::Bitset events, CallbackEvent cb, void *arg, const struct timeval *tv) |
| Register new event notification. More... | |
| bool | loop_exit (const struct timeval *tv) |
| Stop dispatching. More... | |
| int | dispatch () |
Wait for registered notifications, and when they become active dispatch them. More... | |
Private Member Functions | |
| EventBase (std::unique_ptr< impl > &&pImpl) | |
Private Attributes | |
| std::unique_ptr< impl > | pImpl_ |
Friends | |
| class | EventHttp |
| class | EventBuffer |
Main event registration and dispatch engine
Wrapper for event_base structure from libevent.
| using EventBase::CallbackEvent = void (*)(SocketHandle, short, void *) |
| EventBase::EventBase | ( | ) |
| EventBase::EventBase | ( | EventBase && | event | ) |
|
default |
|
private |
| int EventBase::dispatch | ( | ) |
Wait for registered notifications, and when they become active dispatch them.
If there is no event registered return.
| bool EventBase::loop_exit | ( | const struct timeval * | tv | ) |
Stop dispatching.
While some thread is blocked inside dispatch method, some other thread might call this function to notify and break the dispatching loop inside dispatch.
| false | if breaking the loop fails |
| true | if event breaking the loop was scheduled |
| bool EventBase::once | ( | const SocketHandle | fd, |
| const EventFlags::Bitset | events, | ||
| CallbackEvent | cb, | ||
| void * | arg, | ||
| const struct timeval * | tv | ||
| ) |
Register new event notification.
Depending on arguments, the function may register notification for: socket read/write, timeout, signal handler.
| false | if registration fails |
| true | if event was scheduled |
|
friend |
|
friend |
|
private |