Function gnunet_sys::GNUNET_SCHEDULER_add_file_with_priority[][src]

pub unsafe extern "C" fn GNUNET_SCHEDULER_add_file_with_priority(
    delay: GNUNET_TIME_Relative,
    priority: GNUNET_SCHEDULER_Priority,
    fd: *const GNUNET_DISK_FileHandle,
    on_read: c_int,
    on_write: c_int,
    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 the specified file descriptor is ready. The delay can be used as a timeout on the socket being ready. The task will be scheduled for execution once either the delay has expired or the socket operation is 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 delay when should this operation time out? @param priority priority of the task @param fd file-descriptor @param on_read whether to poll the file-descriptor for readability @param on_write whether to poll the file-descriptor for writability @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!