Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
Go to the documentation of this file.
8 #ifndef CORE_SERVER_TASK_INCLUDE_ASYNC_TASK_H_
9 #define CORE_SERVER_TASK_INCLUDE_ASYNC_TASK_H_
45 void *(*at_run_fn) (
void *data_p);
bool RunAsyncTask(AsyncTask *task_p)
Run an AsyncTask.
AsyncTaskNode * AllocateAsyncTaskNode(AsyncTask *task_p, MEM_FLAG mem)
Create an AsyncTaskNode.
struct SyncData * at_sync_data_p
The SyncData used to coordinate data access between the AsyncTask and other processes.
Definition: async_task.h:34
MEM_FLAG
An enum specifying the particular status of a piece of dynamically allocated memory for a particular ...
Definition: memory_allocations.h:38
void SetAsyncTaskConsumer(AsyncTask *task_p, EventConsumer *consumer_p, MEM_FLAG mem)
Set the EventConsumer for a given AsyncTask.
void FreeAsyncTaskNode(ListItem *node_p)
Free an AsyncTaskNode.
void SetAsyncTaskRunData(AsyncTask *task_p, void *(*run_fn)(void *data_p), void *data_p)
Set the callback function that an AsyncTask will call when it is ran.
MEM_FLAG atn_mem
The memory flag indicating what action to perform upon atn_task_p when this AsyncTaskNode is freed.
Definition: async_task.h:86
bool CloseAllAsyncTasks(void)
Close all currently running AsyncTasks for the current process.
A datatype to use to run tasks asynchronously.
Definition: async_task.h:25
MEM_FLAG at_consumer_mem
The memory flag indicating the ownership of the EventConsumer.
Definition: async_task.h:58
AsyncTask * atn_task_p
The AsyncTask to store on the list.
Definition: async_task.h:79
#define GRASSROOTS_TASK_API
Definition: grassroots_task_library.h:46
void RunEventConsumerFromAsyncTask(AsyncTask *task_p)
Run the EventConsumer for the given AsyncTask.
bool SetAsyncTaskSyncData(AsyncTask *task_p, SyncData *sync_data_p, MEM_FLAG mem)
Set the SyncData for an AsyncTask.
A datatype to allow storing AsynTasks on a LinkedList.
Definition: async_task.h:73
OperationStatus
The current status of an Operation.
Definition: operation.h:96
EventConsumer * at_consumer_p
An EventConsumer to notify when the AsyncTask has finished running.
Definition: async_task.h:55
void FreeAsyncTask(AsyncTask *task_p)
Free an AsyncTask.
A datatype that allows data to be shared between tasks (e.g.
Definition: linux_sync_data.h:30
A datatype for storing AsyncTasks in a collection.
Definition: async_tasks_manager.h:24
void ClearAsyncTask(AsyncTask *task_p)
Clear an AsyncTask.
bool InitialiseAsyncTask(AsyncTask *task_p, const char *name_s, struct AsyncTasksManager *manager_p, bool add_flag)
Initialise an AsyncTask.
An EvenetConsumer is a datatype to allow an object to be notified when an AsyncTask has completed run...
Definition: event_consumer.h:44
bool IsAsyncTaskRunning(const AsyncTask *task_p)
Check whether an AsyncTask is currently running.
MEM_FLAG at_sync_data_mem
The memory flag indicating the ownership of the SyncData.
Definition: async_task.h:37
struct AsyncTasksManager * at_manager_p
The AsyncTasksManager that has this AsyncTask.
Definition: async_task.h:65
AsyncTask * AllocateAsyncTask(const char *name_s, struct AsyncTasksManager *manager_p, bool add_flag)
Create an AsyncTask.
OperationStatus RunProcess(const char *const command_line_s)
ListItem atn_node
The base list node.
Definition: async_task.h:76
void CloseAsyncTask(AsyncTask *task_p)
Stop a the given AsyncTask if it is currently running.
void * at_data_p
Any custom data that will be passed to at_fun_fn.
Definition: async_task.h:50
char * at_name_s
The name of the AsyncTask.
Definition: async_task.h:28
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43