Files
ray/state/task_queue.h
T
Philipp Moritz db8c0acc71 Refactor state database (#22)
* make db_connect return the connection

* rename db_conn -> db_handle

* more renaming

* clang-format

* free the db_handle
2016-09-25 21:52:06 -07:00

34 lines
1.1 KiB
C

#ifndef TASK_QUEUE_H
#define TASK_QUEUE_H
#include "db.h"
#include "task.h"
/* The task ID is a deterministic hash of the function ID that
* the task executes and the argument IDs or argument values */
typedef unique_id task_id;
/* The task instance ID is a globally unique ID generated which
* identifies this particular execution of the task */
typedef unique_id task_iid;
/* The node id is an identifier for the node the task is
* scheduled on */
typedef unique_id node_id;
/* Callback for subscribing to the task queue. The only argument this
* callback gets is the task_id of the. */
typedef void (*task_queue_callback)(task_iid *task_iid, task_spec *task);
/* Submit task to the global scheduler. */
void task_queue_submit_task(db_handle *db, task_iid task_iid, task_spec *task);
/* Submit task to a local scheduler based on the decision made by the global
* scheduler. */
void task_queue_schedule_task(db_handle *db, task_iid task_iid, node_id node);
/* Subscribe to task queue. */
void task_queue_register_callback(db_handle *db, task_queue_callback callback);
#endif