![]() |
BSB Developer Docs
|
fetch() JS API implementation More...
Go to the source code of this file.
Data Structures | |
| struct | JsFetchEvent |
| struct | JsFetchDataEvent |
| struct | JsFetchFetch |
| struct | JsFetchSink |
| struct | JsFetchPromise |
| struct | JsFetchResponse |
| struct | JsFetch |
Typedefs | |
| typedef struct JsFetch | JsFetch |
| typedef enum JsFetchEventType | JsFetchEventType |
| typedef struct JsFetchEvent | JsFetchEvent |
| typedef enum JsFetchDataEventType | JsFetchDataEventType |
| typedef struct JsFetchDataEvent | JsFetchDataEvent |
| typedef bool(* | JsFetchDataSinkCallback) (JsFetch *instance, JsFetchDataEvent *event, void *callback_context) |
| Data sink callback - called when there is new event. | |
| typedef struct JsFetchFetch | JsFetchFetch |
| typedef struct JsFetchSink | JsFetchSink |
| typedef struct JsFetchPromise | JsFetchPromise |
| typedef struct JsFetchResponse | JsFetchResponse |
Functions | |
| M_DEQUE_DEF (DataEventQueue, JsFetchDataEvent, M_POD_OPLIST) | |
| void | js_setup_fetch (void) |
| void | js_fetch_process_event (const JsFetchEvent *event) |
| bool | js_fetch_set_data_sink (JsFetch *instance, JsFetchDataSinkCallback callback, void *callback_context) |
| Set a data sink which receives incoming data chunks. | |
| void | js_fetch_data_sink_ready (JsFetch *instance) |
| Indicate that a data sink is ready to receive new data. | |
| bool | js_fetch_cancel (JsFetch *instance) |
| Cancel ongoing fetch activity. | |
| void | js_fetch_abort (JsFetch *instance) |
| If fetch thread is running, indicate it to stop. | |
Variables | |
| const jerry_object_native_info_t | js_fetch_response_native_info |
fetch() JS API implementation
| typedef bool( * JsFetchDataSinkCallback) (JsFetch *instance, JsFetchDataEvent *event, void *callback_context) |
Data sink callback - called when there is new event.
| void js_fetch_abort | ( | JsFetch * | instance | ) |
If fetch thread is running, indicate it to stop.
| instance | JsFetch instance |
| bool js_fetch_cancel | ( | JsFetch * | instance | ) |
Cancel ongoing fetch activity.
| instance | JsFetch instance |
| void js_fetch_data_sink_ready | ( | JsFetch * | instance | ) |
Indicate that a data sink is ready to receive new data.
| instance | JsFetch instance |
| bool js_fetch_set_data_sink | ( | JsFetch * | instance, |
| JsFetchDataSinkCallback | callback, | ||
| void * | callback_context ) |
Set a data sink which receives incoming data chunks.
Data sink, when set, has an exclusive access to data chunks through its callback. It is not possible to set another data sink.
| instance | JsFetch instance |
| callback_context | user pointer to be passed to the callback |
| callback | if NULL, data sink is no more |