Is it possible to receive a periodic generic event on a NIO Selector in Java? On boost::asio I’ve used a deadline_timer before.
For example, I want to call a function once a second on the same thread the selector is running, independently on the amount of load the active sockets on the selector (except for the special cases like taking more than one second to handle an incoming socket message).
Something like this might work: