More W32 resolver workarounds
[oweals/gnunet.git] / src / include / gnunet_scheduler_lib.h
index 83d9d261a59affa9083ac455a9aac34eec98cdfa..ec605a3fd56d6920a48ea26d095b081f19fd26ed 100644 (file)
@@ -235,7 +235,7 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls);
 
 
 /**
- * Request the shutdown of a scheduler.  Marks all currently
+ * Request the shutdown of the scheduler.  Marks all currently
  * pending tasks as ready because of shutdown.  This will
  * cause all tasks to run (as soon as possible, respecting
  * priorities and prerequisite tasks).  Note that tasks
@@ -466,6 +466,31 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
                                 GNUNET_SCHEDULER_Task task, void *task_cls);
 
 
+/**
+ * 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.
+ *
+ * @param delay when should this operation time out? Use
+ *        #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
+ * @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 "task" is started!
+ */
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_net_with_priority  (struct GNUNET_TIME_Relative delay,
+                                         enum GNUNET_SCHEDULER_Priority priority,
+                                         struct GNUNET_NETWORK_Handle *fd,
+                                         int on_read, int on_write,
+                                         GNUNET_SCHEDULER_Task task, void *task_cls);
+
 /**
  * Schedule a new task to be run with a specified delay or when the
  * specified file descriptor is ready for reading.  The delay can be
@@ -508,6 +533,32 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
                                  GNUNET_SCHEDULER_Task task, void *task_cls);
 
 
+/**
+ * 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.
+ *
+ * @param delay when should this operation time out? Use
+ *        #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
+ * @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!
+ */
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
+                                         enum GNUNET_SCHEDULER_Priority priority,
+                                         const struct GNUNET_DISK_FileHandle *fd,
+                                         int on_read, int on_write,
+                                         GNUNET_SCHEDULER_Task task, void *task_cls);
+
+
 /**
  * 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