16#include <unordered_map>
18#include "pw_assert/assert.h"
19#include "pw_async2/runnable_dispatcher.h"
29 enum FileDescriptorType {
32 kReadWrite = kReadable | kWritable,
35 Status NativeRegisterFileDescriptor(
int fd, FileDescriptorType type);
36 Status NativeUnregisterFileDescriptor(
int fd);
38 Waker& NativeAddReadWakerForFileDescriptor(
int fd) {
39 return wakers_[fd].read;
42 Waker& NativeAddWriteWakerForFileDescriptor(
int fd) {
43 return wakers_[fd].write;
47 friend class ::pw::async2::Dispatcher;
49 static constexpr size_t kMaxEventsToProcessAtOnce = 5;
51 struct ReadWriteWaker {
60 Status NativeWaitForWake();
61 void NativeFindAndWakeFileDescriptor(
int fd, FileDescriptorType type);
67 std::unordered_map<int, ReadWriteWaker> wakers_;
Definition: epoll_dispatcher.h:23
void DoWaitForWake() override
Definition: runnable_dispatcher.h:24