16#include <unordered_map>
18#include "pw_assert/assert.h"
19#include "pw_async2/runnable_dispatcher.h"
31 enum FileDescriptorType {
34 kReadWrite = kReadable | kWritable,
37 Status NativeRegisterFileDescriptor(
int fd, FileDescriptorType type);
38 Status NativeUnregisterFileDescriptor(
int fd);
40 Waker& NativeAddReadWakerForFileDescriptor(
int fd) {
41 return wakers_[fd].read;
44 Waker& NativeAddWriteWakerForFileDescriptor(
int fd) {
45 return wakers_[fd].write;
49 friend class ::pw::async2::Dispatcher;
51 static constexpr size_t kMaxEventsToProcessAtOnce = 5;
53 struct ReadWriteWaker {
62 Status NativeWaitForWake();
63 void NativeFindAndWakeFileDescriptor(
int fd, FileDescriptorType type);
69 std::unordered_map<int, ReadWriteWaker> wakers_;
Definition: epoll_dispatcher.h:25
void DoWaitForWake() override
Definition: runnable_dispatcher.h:24