Function gnunet_sys::GNUNET_SCHEDULER_add_select[][src]

pub unsafe extern "C" fn GNUNET_SCHEDULER_add_select(
    prio: GNUNET_SCHEDULER_Priority,
    delay: GNUNET_TIME_Relative,
    rs: *const GNUNET_NETWORK_FDSet,
    ws: *const GNUNET_NETWORK_FDSet,
    task: GNUNET_SCHEDULER_TaskCallback,
    task_cls: *mut c_void
) -> *mut GNUNET_SCHEDULER_Task

Schedule a new task to be run with a specified delay or when any of the specified file descriptor sets is ready. The delay can be used as a timeout on the socket(s) being ready. The task will be scheduled for execution once either the delay has expired or any of the socket operations is ready. This is the most general function of the “add” family. Note that the “prerequisite_task” must be satisfied in addition to any of the other conditions. In other words, the task will be started when (prerequisite-run) && (delay-ready || any-rs-ready || any-ws-ready) ) Only allowed to be called as long as the scheduler is running, that is one of the following conditions is met:

  • #GNUNET_SCHEDULER_run has been called and has not returned yet
  • #GNUNET_SCHEDULER_driver_init has been run and #GNUNET_SCHEDULER_driver_done has not been called yet

@param prio how important is this task? @param delay how long should we wait? @param rs set of file descriptors we want to read (can be NULL) @param ws set of file descriptors we want to write (can be NULL) @param task main function of the task @param task_cls closure of @a task @return unique task identifier for the job only valid until @a task is started!