Skip to content

Commit 662b41f

Browse files
author
Sivaram Prasad Pulla
committed
Updating AppRegistry.md to add documentation for new methods
Added documentation for registerCancellableHeadlessTask and cancelHeadlessTask. Fixed parameter names for parameters which were renamed.
1 parent 8f0d30c commit 662b41f

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

docs/appregistry.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ To "stop" an application when a view should be destroyed, call `AppRegistry.unmo
3636
* [`runApplication`](appregistry.md#runapplication)
3737
* [`unmountApplicationComponentAtRootTag`](appregistry.md#unmountapplicationcomponentatroottag)
3838
* [`registerHeadlessTask`](appregistry.md#registerheadlesstask)
39+
* [`registerCancellableHeadlessTask`](appregistry.md#registercancellableheadlesstask)
3940
* [`startHeadlessTask`](appregistry.md#startheadlesstask)
41+
* [`cancelHeadlessTask`](appregistry.md#cancelheadlesstask)
4042

4143
---
4244

@@ -151,13 +153,22 @@ static unmountApplicationComponentAtRootTag(rootTag)
151153
### `registerHeadlessTask()`
152154
153155
```javascript
154-
static registerHeadlessTask(taskKey, task)
156+
static registerHeadlessTask(taskKey, taskProvider)
155157
```
156158
157-
Register a headless task. A headless task is a bit of code that runs without a UI. @param taskKey the key associated with this task @param task a promise returning function that takes some data passed from the native side as the only argument; when the promise is resolved or rejected the native side is notified of this event and it may decide to destroy the JS context.
159+
Register a headless task. A headless task is a bit of code that runs without a UI. @param taskKey the key associated with this task @param taskProvider a promise returning function that takes some data passed from the native side as the only argument; when the promise is resolved or rejected the native side is notified of this event and it may decide to destroy the JS context.
158160
159161
---
160162
163+
### `registerCancellableHeadlessTask()`
164+
165+
```javascript
166+
static registerCancellableHeadlessTask(taskKey, taskProvider, taskCancelProvider)
167+
```
168+
169+
Register a headless task which can be cancelled. A headless task is a bit of code that runs without a UI. @param taskKey the key associated with this task @param taskProvider a promise returning function that takes some data passed from the native side as the only argument; when the promise is resolved or rejected the native side is notified of this event and it may decide to destroy the JS context. @param taskCancelProvider a void returning function that takes no arguments; when a cancellation is requested, the function being executed by taskProvider should wrap up and return ASAP.
170+
---
171+
161172
### `startHeadlessTask()`
162173
163174
```javascript
@@ -167,3 +178,15 @@ static startHeadlessTask(taskId, taskKey, data)
167178
Only called from native code. Starts a headless task.
168179
169180
@param taskId the native id for this task instance to keep track of its execution @param taskKey the key for the task to start @param data the data to pass to the task
181+
182+
---
183+
184+
### `cancelHeadlessTask()`
185+
186+
```javascript
187+
static cancelHeadlessTask(taskId, taskKey)
188+
```
189+
190+
Only called from native code. Cancels a headless task.
191+
192+
@param taskId the native id for this task instance that was used when startHeadlessTask was called @param taskKey the key for the task that was used when startHeadlessTask was called

0 commit comments

Comments
 (0)