Task Stub is a poorly-named representation of a remote Task that can be exposed to JS.
◆ taskid_t
◆ tf_packetstream_t
◆ tf_task_t
◆ tf_taskstub_t
A handle to another task.
◆ tf_taskstub_create_parent()
Create a task stub representing the parent task of the running process.
- Parameters
-
task | The running task. |
file | A file descriptor of a pipe connected to a parent process task. |
- Returns
- The created task stub.
◆ tf_taskstub_get_id()
Get a unique identifier for the task stub.
- Parameters
-
- Returns
- An identifier for the stub.
◆ tf_taskstub_get_owner()
Get the task owning the task stub.
- Parameters
-
- Returns
- The task from which the task stub was created.
◆ tf_taskstub_get_stream()
Get the packet stream that can be used to communicate with the task stub.
- Parameters
-
- Returns
- The packet stream.
◆ tf_taskstub_get_task_object()
JSValue tf_taskstub_get_task_object |
( |
const tf_taskstub_t * |
stub | ) |
|
Get the JS object representing the task stub.
- Parameters
-
- Returns
- The JS object.
◆ tf_taskstub_on_error()
void tf_taskstub_on_error |
( |
tf_taskstub_t * |
stub, |
|
|
JSValue |
error |
|
) |
| |
Report an error to a task stub.
- Parameters
-
stub | The stub to which to report th eerror. |
error | The error to report. |
◆ tf_taskstub_on_print()
void tf_taskstub_on_print |
( |
tf_taskstub_t * |
stub, |
|
|
JSValue |
arguments |
|
) |
| |
Print to a task stub.
- Parameters
-
stub | The task stub to which to print. |
arguments | The values to print. |
◆ tf_taskstub_register()
JSValue tf_taskstub_register |
( |
JSContext * |
context | ) |
|
Register the task stub script interface.
- Parameters
-
- Returns
- The task stub constructor.
◆ tf_taskstub_startup()
void tf_taskstub_startup |
( |
| ) |
|
Initialize task stub. Call before using the rest.