Wiki page futures.md changed with summary [] by Dmitri Chudinov

This commit is contained in:
Dmitri Chudinov 2022-05-21 04:17:18 -07:00 committed by www-data
parent 975d8e43c9
commit c132907ed1
1 changed files with 7 additions and 7 deletions

View File

@ -55,7 +55,7 @@ You can attach arbitrary data to ``Eina_Promise``s which you can later retrieve
Finally when creating ``Eina_Promise``s you should **always** provide a ``_cancel_callback`` as above, so you're notified if the promise is cancelled. This is chiefly because any pointer you might be keeping to the cancelled promise will be invalid after the callback but also because you have a chance to stop whatever process you had running to obtain the promised value.
See an example in [Test 1 of eina_future.c](https://git.enlightenment.org/tools/examples.git/tree/reference/c/eina/src/eina_future.c#n91).
See an example in [Test 1 of eina_future.c](https://git.enlightenment.org/enlightenment/examples/src/branch/master/reference/c/eina/src/eina_future.c#n91).
## Creating a Future ##
@ -80,7 +80,7 @@ The ``success`` callback will be triggered when the promise is fulfilled and wil
You can pass any data you want when registering callbacks. They will receive it through the ``data`` parameter. Use the ``free`` callback to free it since it will be called no matter what way the promise ends (successfully resolved or cancelled).
See an example in [Test 1 of eina_future.c](https://git.enlightenment.org/tools/examples.git/tree/reference/c/eina/src/eina_future.c#n97).
See an example in [Test 1 of eina_future.c](https://git.enlightenment.org/enlightenment/examples/src/branch/master/reference/c/eina/src/eina_future.c#n97).
## Resolving a Promise ##
@ -98,7 +98,7 @@ Resolving a promise means delivering the promised value. This is done through an
All the callback methods registered with this promise (through ``Eina_Future`` objects as seen above) will be called and the ``Eina_Value`` will be delivered to them.
See an example in [Test 1 of eina_future.c](https://git.enlightenment.org/tools/examples.git/tree/reference/c/eina/src/eina_future.c#n69).
See an example in [Test 1 of eina_future.c](https://git.enlightenment.org/enlightenment/examples/src/branch/master/reference/c/eina/src/eina_future.c#n69).
## Rejecting a Promise ##
@ -114,7 +114,7 @@ Sometimes the code that delivers a promise can't fulfill it (think of a server r
Instead of the ``success`` callback used in normal promise resolution, all ``Eina_Future`` objects registered to the rejected ``Eina_Promise`` will have their ``error`` callback triggered. Instead of the promised ``Eina_Value`` they'll receive the ``Eina_Error`` provided to ``eina_promise_reject()``.
See an example in [Test 2 of eina_future.c](https://git.enlightenment.org/tools/examples.git/tree/reference/c/eina/src/eina_future.c#n118).
See an example in [Test 2 of eina_future.c](https://git.enlightenment.org/enlightenment/examples/src/branch/master/reference/c/eina/src/eina_future.c#n118).
## Cancelling a Future ##
@ -142,7 +142,7 @@ Future cancellation is achieved through ``efl_future_cancel()``:
In the above example, ``_promise_cancel_cb()`` will be called to notify the promise-fulfilling code that it has been cancelled. In addition to this ``_promise_error_cb()`` will be called to notify any code waiting on the promised value that it will never arrive (the reported error will be ``EINA_ERROR_FUTURE_CANCEL``).
See an example in [Test 3 of eina_future.c](https://git.enlightenment.org/tools/examples.git/tree/reference/c/eina/src/eina_future.c#n196).
See an example in [Test 3 of eina_future.c](https://git.enlightenment.org/enlightenment/examples/src/branch/master/reference/c/eina/src/eina_future.c#n196).
## Chaining Futures ##
@ -167,7 +167,7 @@ Note also how each callback can have different data passed to it.
A rejection of the promise or the cancellation of any of the futures will cancel the whole chain.
See an example in [Test 4 of eina_future.c](https://git.enlightenment.org/tools/examples.git/tree/reference/c/eina/src/eina_future.c#n265).
See an example in [Test 4 of eina_future.c](https://git.enlightenment.org/enlightenment/examples/src/branch/master/reference/c/eina/src/eina_future.c#n265).
## Callbacks and Easy Callbacks ##
@ -224,5 +224,5 @@ Due to the particular syntax of these methods (making use of ISO C99's Designate
[Eina Generic Value Programming Guide](/develop/guides/c/eina/generic-value.md)
: Programming guide for the ``Eina_value`` class.
[reference/c/eina/src/eina_future.c](https://git.enlightenment.org/tools/examples.git/tree/reference/c/eina/src/eina_future.c)
[reference/c/eina/src/eina_future.c](https://git.enlightenment.org/enlightenment/examples/src/branch/master/reference/c/eina/src/eina_future.c)
: Set of examples using ``Eina_Promise`` and ``Eina_Future``.