Class Reactor
java.lang.Object
com.codename1.backend.Reactor
Readiness notification over epoll (Linux) or kqueue (macOS/BSD).
Level-triggered: the poller hands a ready descriptor to a worker and forgets about it until the worker gives it back. Edge-triggered would require draining every descriptor to EAGAIN on each wake-up, which is the opposite of that.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeliver an event for this descriptor ONCE and then disarm it, untilmodify(int, int)re-arms it.static final intstatic final int -
Method Summary
-
Field Details
-
READ
public static final int READ- See Also:
-
WRITE
public static final int WRITE- See Also:
-
ONESHOT
public static final int ONESHOTDeliver an event for this descriptor ONCE and then disarm it, until
modify(int, int)re-arms it.This is what lets the worker threads poll the same set directly rather than a reactor thread dispatching to them: the kernel guarantees exactly one waiter is handed a given descriptor, so two workers cannot land on one connection. Without it a level-triggered set reports the same descriptor ready to every waiter at once.
- See Also:
-
-
Method Details
-
create
- Throws:
IOException
-
add
- Throws:
IOException
-
modify
- Throws:
IOException
-
remove
public void remove(int fd) -
await
Blocks until something is ready, then fills readyFds and returns how many. A timeout below zero waits forever.- Throws:
IOException
-
close
public void close()
-