16#include <unordered_map>
18#include "pw_assert/assert.h"
19#include "pw_async2/runnable_dispatcher.h"
32 enum FileDescriptorType {
35 kReadWrite = kReadable | kWritable,
38 Status NativeRegisterFileDescriptor(
int fd, FileDescriptorType type);
39 Status NativeUnregisterFileDescriptor(
int fd);
41 Waker& NativeAddReadWakerForFileDescriptor(
int fd) {
42 return wakers_[fd].read;
45 Waker& NativeAddWriteWakerForFileDescriptor(
int fd) {
46 return wakers_[fd].write;
50 friend class ::pw::async2::Dispatcher;
52 static constexpr size_t kMaxEventsToProcessAtOnce = 5;
54 struct ReadWriteWaker {
63 Status NativeWaitForWake();
64 void NativeFindAndWakeFileDescriptor(
int fd, FileDescriptorType type);
70 std::unordered_map<int, ReadWriteWaker> wakers_;
Definition: epoll_dispatcher.h:25
void DoWaitForWake() override
Definition: runnable_dispatcher.h:24