Package kilim.nio

Class NioSelectorScheduler

java.lang.Object
kilim.nio.NioSelectorScheduler

public class NioSelectorScheduler extends Object
This class wraps a selector and runs it in a separate thread. It runs one or more ListenTasks (bound to their respective ports), which in turn spawn as many session tasks (see listen(int, Class, Scheduler)) as the number of new http connections. The supplied scheduler is used to execute the tasks. It is possible, although not typical, to run tasks in the NioSelectorScheduler itself, as it too is a scheduler. Usage is as follows:
  NioSelectorScheduler nss = new NioSelectorScheduler();
  nss.listen(8080, MySessionTask.class, Scheduler.getDefaultScheduler();
  
  class MySessionTask extends SessionTask {
  ...
  }
 
See Also: