2021-01-02 13:10:00 -05:00
|
|
|
#pragma once
|
|
|
|
|
2024-02-20 21:41:37 -05:00
|
|
|
/**
|
|
|
|
** \defgroup taskstub Task Stub
|
|
|
|
** Task Stub is a poorly-named representation of a remote Task that can be
|
|
|
|
** exposed to JS.
|
|
|
|
** @{
|
|
|
|
*/
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
#include "quickjs.h"
|
2023-05-21 17:36:51 -04:00
|
|
|
#include "uv.h"
|
2021-01-02 13:10:00 -05:00
|
|
|
|
|
|
|
typedef int taskid_t;
|
|
|
|
|
|
|
|
typedef struct _tf_packetstream_t tf_packetstream_t;
|
|
|
|
typedef struct _tf_task_t tf_task_t;
|
|
|
|
typedef struct _tf_taskstub_t tf_taskstub_t;
|
|
|
|
|
|
|
|
void tf_taskstub_startup();
|
2021-10-24 11:46:30 -04:00
|
|
|
JSValue tf_taskstub_register(JSContext* context);
|
2021-01-02 13:10:00 -05:00
|
|
|
taskid_t tf_taskstub_get_id(const tf_taskstub_t* stub);
|
|
|
|
JSValue tf_taskstub_get_task_object(const tf_taskstub_t* stub);
|
|
|
|
tf_packetstream_t* tf_taskstub_get_stream(const tf_taskstub_t* stub);
|
|
|
|
tf_task_t* tf_taskstub_get_owner(const tf_taskstub_t* stub);
|
|
|
|
tf_taskstub_t* tf_taskstub_create_parent(tf_task_t* task, uv_file file);
|
|
|
|
void tf_taskstub_on_error(tf_taskstub_t* stub, JSValue error);
|
2022-02-13 17:39:22 -05:00
|
|
|
void tf_taskstub_on_print(tf_taskstub_t* stub, JSValue arguments);
|
2024-02-20 21:41:37 -05:00
|
|
|
|
|
|
|
/** @} */
|