AWS IoT Device SDK C: Task Pool
Task pool library
Return to main page ↑
IotTaskPool_CreateRecyclableJob

Creates a job for the task pool by allocating the job dynamically.

IotTaskPoolRoutine_t userCallback,
void * pUserContext,
IotTaskPoolJob_t * const pJob );

A recyclable job does not need to be allocated twice, but it can rather be reused through subsequent calls to IotTaskPool_CreateRecyclableJob.

Parameters
[in]taskPoolA handle to the task pool for which to create a recyclable job.
[in]userCallbackA user-specified callback for the job.
[in]pUserContextA user-specified context for the callback.
[out]pJobA pointer to an instance of IotTaskPoolJob_t that will be initialized when this function returns successfully. This handle can be used to inspect the job status with IotTaskPool_GetStatus or cancel the job with IotTaskPool_TryCancel, etc....
Returns
One of the following:
Warning
A recyclable job should be recycled with a call to IotTaskPool_RecycleJob rather than destroyed.