\hypertarget{group__Eina__Future__Callbacks}{}\doxysection{Eina Future Callbacks}
\label{group__Eina__Future__Callbacks}\index{Eina Future Callbacks@{Eina Future Callbacks}}


Methods and structures dealing with \mbox{\hyperlink{structEina__Future}{Eina\+\_\+\+Future}} callbacks.  


\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{struct__Eina__Future__Schedule__Entry}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Schedule\+\_\+\+Entry}}
\begin{DoxyCompactList}\small\item\em A struct that represents an scheduled event. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{struct__Eina__Future__Scheduler}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Scheduler}}
\begin{DoxyCompactList}\small\item\em This struct is used as a bridge between Eina and the future scheduler. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{struct__Eina__Future__Cb__Easy__Desc}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Easy\+\_\+\+Desc}}
\begin{DoxyCompactList}\small\item\em A struct with callbacks to be used by \mbox{\hyperlink{group__Eina__Future_gaacfe9df476304cd36069907863bf12cc}{eina\+\_\+future\+\_\+cb\+\_\+easy\+\_\+from\+\_\+desc()}} and \mbox{\hyperlink{group__Eina__Future_ga57f56d13f3f3bb13651ea3b81b59e8f1}{eina\+\_\+future\+\_\+cb\+\_\+easy()}} \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{struct__Eina__Future__Cb__Console__Desc}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Console\+\_\+\+Desc}}
\begin{DoxyCompactList}\small\item\em A struct used to define the prefix and suffix to be printed along side the a future value. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{struct__Eina__Future__Cb__Log__Desc}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Log\+\_\+\+Desc}}
\begin{DoxyCompactList}\small\item\em This struct is used by \mbox{\hyperlink{group__Eina__Future_ga92d96ceed9cc6af49bc35c31704c31a1}{eina\+\_\+future\+\_\+cb\+\_\+log\+\_\+from\+\_\+desc()}} and its contents will be routed to \mbox{\hyperlink{group__Eina__Log__Group_ga2ad47c77225cbcf8d35840547b5bbbe4}{eina\+\_\+log\+\_\+print()}} along side the future value. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eina__Future__Callbacks_ga2c756a80e0b4a4a39737c5e3a8d0f2e6}\label{group__Eina__Future__Callbacks_ga2c756a80e0b4a4a39737c5e3a8d0f2e6}} 
typedef struct \mbox{\hyperlink{struct__Eina__Future__Cb__Easy__Desc}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Easy\+\_\+\+Desc}} \mbox{\hyperlink{group__Eina__Future__Callbacks_ga2c756a80e0b4a4a39737c5e3a8d0f2e6}{Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Easy\+\_\+\+Desc}}
\begin{DoxyCompactList}\small\item\em Convenience wrapper over \mbox{\hyperlink{struct__Eina__Future__Cb__Easy__Desc}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Easy\+\_\+\+Desc}}. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eina__Future__Callbacks_gaf5fa825519a3d7f8e084aba309316bc4}\label{group__Eina__Future__Callbacks_gaf5fa825519a3d7f8e084aba309316bc4}} 
typedef struct \mbox{\hyperlink{struct__Eina__Future__Cb__Console__Desc}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Console\+\_\+\+Desc}} \mbox{\hyperlink{group__Eina__Future__Callbacks_gaf5fa825519a3d7f8e084aba309316bc4}{Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Console\+\_\+\+Desc}}
\begin{DoxyCompactList}\small\item\em Convenience wrapper over \mbox{\hyperlink{struct__Eina__Future__Cb__Console__Desc}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Console\+\_\+\+Desc}}. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eina__Future__Callbacks_ga190fb0e75b86d093db85b05abfd21ebd}\label{group__Eina__Future__Callbacks_ga190fb0e75b86d093db85b05abfd21ebd}} 
typedef struct \mbox{\hyperlink{struct__Eina__Future__Scheduler}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Scheduler}} \mbox{\hyperlink{group__Eina__Future__Callbacks_ga190fb0e75b86d093db85b05abfd21ebd}{Eina\+\_\+\+Future\+\_\+\+Scheduler}}
\begin{DoxyCompactList}\small\item\em Convenience wrapper over \mbox{\hyperlink{struct__Eina__Future__Scheduler}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Scheduler}}. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eina__Future__Callbacks_ga8ecbf4d4816b354fad992cd5874c656a}\label{group__Eina__Future__Callbacks_ga8ecbf4d4816b354fad992cd5874c656a}} 
typedef struct \mbox{\hyperlink{struct__Eina__Future__Schedule__Entry}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Schedule\+\_\+\+Entry}} \mbox{\hyperlink{group__Eina__Future__Callbacks_ga8ecbf4d4816b354fad992cd5874c656a}{Eina\+\_\+\+Future\+\_\+\+Schedule\+\_\+\+Entry}}
\begin{DoxyCompactList}\small\item\em Convenience wrapper over \mbox{\hyperlink{struct__Eina__Future__Schedule__Entry}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Schedule\+\_\+\+Entry}}. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eina__Future__Callbacks_ga6d17eda361b40db4ebaf034a993a03fe}\label{group__Eina__Future__Callbacks_ga6d17eda361b40db4ebaf034a993a03fe}} 
typedef struct \mbox{\hyperlink{struct__Eina__Future__Cb__Log__Desc}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Log\+\_\+\+Desc}} \mbox{\hyperlink{group__Eina__Future__Callbacks_ga6d17eda361b40db4ebaf034a993a03fe}{Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Log\+\_\+\+Desc}}
\begin{DoxyCompactList}\small\item\em Convenience wrapper over \mbox{\hyperlink{struct__Eina__Future__Cb__Log__Desc}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Log\+\_\+\+Desc}}. \end{DoxyCompactList}\item 
typedef \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}}($\ast$ \mbox{\hyperlink{group__Eina__Future__Callbacks_ga43d2d4c20a2f7aee2a25ada34a9cc675}{Eina\+\_\+\+Future\+\_\+\+Cb}}) (void $\ast$data, const \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} value, const \mbox{\hyperlink{structEina__Future}{Eina\+\_\+\+Future}} $\ast$dead\+\_\+future)
\begin{DoxyCompactList}\small\item\em A callback used to inform that a future was resolved. \end{DoxyCompactList}\item 
typedef void($\ast$ \mbox{\hyperlink{group__Eina__Future__Callbacks_gac685b488df7948131b6405451d0b4fb5}{Eina\+\_\+\+Future\+\_\+\+Scheduler\+\_\+\+Cb}}) (\mbox{\hyperlink{structEina__Future}{Eina\+\_\+\+Future}} $\ast$f, \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} value)
\begin{DoxyCompactList}\small\item\em A callback used by the \mbox{\hyperlink{group__Eina__Future__Callbacks_ga190fb0e75b86d093db85b05abfd21ebd}{Eina\+\_\+\+Future\+\_\+\+Scheduler}} to deliver the future operation result. \end{DoxyCompactList}\item 
typedef void($\ast$ \mbox{\hyperlink{group__Eina__Future__Callbacks_gab618b4d7aef449893108219332d8a85e}{Eina\+\_\+\+Promise\+\_\+\+Cancel\+\_\+\+Cb}}) (void $\ast$data, const \mbox{\hyperlink{structEina__Promise}{Eina\+\_\+\+Promise}} $\ast$dead\+\_\+promise)
\begin{DoxyCompactList}\small\item\em A callback used to inform that a promise was canceled. \end{DoxyCompactList}\item 
typedef \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}}($\ast$ \mbox{\hyperlink{group__Eina__Future__Callbacks_ga9dfebda67e96766ede62d657c1991655}{Eina\+\_\+\+Future\+\_\+\+Success\+\_\+\+Cb}}) (void $\ast$data, const \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} value)
\begin{DoxyCompactList}\small\item\em A callback used to inform that the future completed with success. \end{DoxyCompactList}\item 
typedef \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}}($\ast$ \mbox{\hyperlink{group__Eina__Future__Callbacks_ga88b867eea465fb367d4974d9cf8d3866}{Eina\+\_\+\+Future\+\_\+\+Error\+\_\+\+Cb}}) (void $\ast$data, const \mbox{\hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error}} error)
\begin{DoxyCompactList}\small\item\em A callback used to inform that the future completed with failure. \end{DoxyCompactList}\item 
typedef void($\ast$ \mbox{\hyperlink{group__Eina__Future__Callbacks_ga3e4a9200b8e67906bf1b1514bc0d93ff}{Eina\+\_\+\+Future\+\_\+\+Free\+\_\+\+Cb}}) (void $\ast$data, const \mbox{\hyperlink{structEina__Future}{Eina\+\_\+\+Future}} $\ast$dead\+\_\+future)
\begin{DoxyCompactList}\small\item\em A callback used to inform that the future was freed and the user should also {\ttfamily free} the {\ttfamily data}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Methods and structures dealing with \mbox{\hyperlink{structEina__Future}{Eina\+\_\+\+Future}} callbacks. 



\doxysubsection{Typedef Documentation}
\mbox{\Hypertarget{group__Eina__Future__Callbacks_ga43d2d4c20a2f7aee2a25ada34a9cc675}\label{group__Eina__Future__Callbacks_ga43d2d4c20a2f7aee2a25ada34a9cc675}} 
\index{Eina Future Callbacks@{Eina Future Callbacks}!Eina\_Future\_Cb@{Eina\_Future\_Cb}}
\index{Eina\_Future\_Cb@{Eina\_Future\_Cb}!Eina Future Callbacks@{Eina Future Callbacks}}
\doxysubsubsection{\texorpdfstring{Eina\_Future\_Cb}{Eina\_Future\_Cb}}
{\footnotesize\ttfamily Eina\+\_\+\+Future\+\_\+\+Cb}



A callback used to inform that a future was resolved. 

Usually this callback is called from a clean context, that is, from the main loop or some platform defined safe context. However there are 2 exceptions\+:

\begin{DoxyItemize}
\item \mbox{\hyperlink{group__Eina__Future_ga6d7a6889b5f1a9fca02f868c484148e7}{eina\+\_\+future\+\_\+cancel()}} was used, it\textquotesingle{}s called immediately in the context that called cancel using {\ttfamily ECANCELED} as error.\end{DoxyItemize}
\begin{DoxyItemize}
\item \mbox{\hyperlink{group__Eina__Future_ga9f4948790f1f84de93ba8195520d4a92}{eina\+\_\+future\+\_\+then()}}, \mbox{\hyperlink{group__Eina__Future_gae4c1896c7eb8b40933c7b0640c881f33}{eina\+\_\+future\+\_\+then\+\_\+from\+\_\+desc()}}, \mbox{\hyperlink{group__Eina__Future_gaeb721d890aa5eac3103a982edde76e9a}{eina\+\_\+future\+\_\+chain()}}, \mbox{\hyperlink{group__Eina__Future_ga5517a17a841d31ad46acf9285a709bbc}{eina\+\_\+future\+\_\+chain\+\_\+array()}} or similar failed due to invalid pointer or memory allocation. Then the callback is called from the failed context using {\ttfamily EINVAL} or {\ttfamily ENOMEM} as errors and {\ttfamily dead\+\_\+future} will be {\ttfamily NULL}.\end{DoxyItemize}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em data} & The data provided by the user\\
\hline
\mbox{\texttt{ in}}  & {\em value} & An \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} which contains the operation result. Before using the {\ttfamily value}, its type must be checked in order to avoid errors. This is needed because if an operation fails the \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} type will be \mbox{\hyperlink{group__Eina__Value__Group_gace284ef9f3063e831b66f04638c7f465}{EINA\+\_\+\+VALUE\+\_\+\+TYPE\+\_\+\+ERROR}} which is a different type than the expected operation result.\\
\hline
\mbox{\texttt{ in}}  & {\em dead\+\_\+future} & A pointer to the future that was completed.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} to pass to the next \mbox{\hyperlink{structEina__Future}{Eina\+\_\+\+Future}} in the chain (if any). If there is no need to convert the received value, it\textquotesingle{}s {\bfseries{recommended}} to passthrough the {\ttfamily value} argument. If you need to convert to a different type or generate a new value, use {\ttfamily \mbox{\hyperlink{group__Eina__Value__Value__Group_gab5c6558b1b8be2ad597d71a765cbf5f6}{eina\+\_\+value\+\_\+setup()}}} on {\bfseries{another}} \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} and return it. By returning a promise \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} (\mbox{\hyperlink{group__Eina__Future_ga6151e485fad1e3623c365d11e319d7da}{eina\+\_\+promise\+\_\+as\+\_\+value()}}) the whole chain will wait until the promise is resolved in order to continue its execution. Note that the value contents must survive this function scope, that is, do {\bfseries{not}} use stack allocated blobs, arrays, structures or types that keep references to memory you give. Values will be automatically cleaned up using {\ttfamily \mbox{\hyperlink{group__Eina__Value__Value__Group_ga940660709a2862bafac92f47bb721a68}{eina\+\_\+value\+\_\+flush()}}} once they are unused (no more future or futures returned a new value).
\end{DoxyReturn}
\begin{DoxyNote}{Note}
The returned value {\bfseries{can}} be an \mbox{\hyperlink{group__Eina__Promise_ga979033926fa12396c080db78bbbe13e9}{EINA\+\_\+\+VALUE\+\_\+\+TYPE\+\_\+\+PROMISE}}! (see \mbox{\hyperlink{group__Eina__Future_ga6151e485fad1e3623c365d11e319d7da}{eina\+\_\+promise\+\_\+as\+\_\+value()}} and \mbox{\hyperlink{group__Eina__Future_ga6b3b9b94ed2b8d324fe8053a1ff8b926}{eina\+\_\+future\+\_\+as\+\_\+value()}}) In this case the future chain will wait until the promise is resolved.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Future_ga6d7a6889b5f1a9fca02f868c484148e7}{eina\+\_\+future\+\_\+cancel()}} 

\mbox{\hyperlink{group__Eina__Future_ga9f4948790f1f84de93ba8195520d4a92}{eina\+\_\+future\+\_\+then()}} 

\mbox{\hyperlink{group__Eina__Future_gae4c1896c7eb8b40933c7b0640c881f33}{eina\+\_\+future\+\_\+then\+\_\+from\+\_\+desc()}} 

\mbox{\hyperlink{group__Eina__Future_ga1125fb075daa2ac3548ee4a55d69190c}{eina\+\_\+future\+\_\+then\+\_\+easy()}} 

\mbox{\hyperlink{group__Eina__Future_gaeb721d890aa5eac3103a982edde76e9a}{eina\+\_\+future\+\_\+chain()}} 

\mbox{\hyperlink{group__Eina__Future_ga5517a17a841d31ad46acf9285a709bbc}{eina\+\_\+future\+\_\+chain\+\_\+array()}} 

\mbox{\hyperlink{group__Eina__Future_ga6b3b9b94ed2b8d324fe8053a1ff8b926}{eina\+\_\+future\+\_\+as\+\_\+value()}} 

\mbox{\hyperlink{group__Eina__Future_ga6151e485fad1e3623c365d11e319d7da}{eina\+\_\+promise\+\_\+as\+\_\+value()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__Eina__Future__Callbacks_gac685b488df7948131b6405451d0b4fb5}\label{group__Eina__Future__Callbacks_gac685b488df7948131b6405451d0b4fb5}} 
\index{Eina Future Callbacks@{Eina Future Callbacks}!Eina\_Future\_Scheduler\_Cb@{Eina\_Future\_Scheduler\_Cb}}
\index{Eina\_Future\_Scheduler\_Cb@{Eina\_Future\_Scheduler\_Cb}!Eina Future Callbacks@{Eina Future Callbacks}}
\doxysubsubsection{\texorpdfstring{Eina\_Future\_Scheduler\_Cb}{Eina\_Future\_Scheduler\_Cb}}
{\footnotesize\ttfamily Eina\+\_\+\+Future\+\_\+\+Scheduler\+\_\+\+Cb}



A callback used by the \mbox{\hyperlink{group__Eina__Future__Callbacks_ga190fb0e75b86d093db85b05abfd21ebd}{Eina\+\_\+\+Future\+\_\+\+Scheduler}} to deliver the future operation result. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em f} & The delivered future. \\
\hline
\mbox{\texttt{ in}}  & {\em value} & The future result\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Promise_gae2c735463cbd7321dbff1f9def0a6957}{eina\+\_\+promise\+\_\+new()}}

\mbox{\hyperlink{group__Eina__Future__Callbacks_ga8ecbf4d4816b354fad992cd5874c656a}{Eina\+\_\+\+Future\+\_\+\+Schedule\+\_\+\+Entry}} 

\mbox{\hyperlink{group__Eina__Future__Callbacks_ga190fb0e75b86d093db85b05abfd21ebd}{Eina\+\_\+\+Future\+\_\+\+Scheduler}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__Eina__Future__Callbacks_gab618b4d7aef449893108219332d8a85e}\label{group__Eina__Future__Callbacks_gab618b4d7aef449893108219332d8a85e}} 
\index{Eina Future Callbacks@{Eina Future Callbacks}!Eina\_Promise\_Cancel\_Cb@{Eina\_Promise\_Cancel\_Cb}}
\index{Eina\_Promise\_Cancel\_Cb@{Eina\_Promise\_Cancel\_Cb}!Eina Future Callbacks@{Eina Future Callbacks}}
\doxysubsubsection{\texorpdfstring{Eina\_Promise\_Cancel\_Cb}{Eina\_Promise\_Cancel\_Cb}}
{\footnotesize\ttfamily void($\ast$ Eina\+\_\+\+Promise\+\_\+\+Cancel\+\_\+\+Cb)(void $\ast$data, const \mbox{\hyperlink{structEina__Promise}{Eina\+\_\+\+Promise}} $\ast$dead\+\_\+promise)}



A callback used to inform that a promise was canceled. 

A promise may be canceled by the user calling {\ttfamily \mbox{\hyperlink{group__Eina__Future_ga6d7a6889b5f1a9fca02f868c484148e7}{eina\+\_\+future\+\_\+cancel()}}} on any \mbox{\hyperlink{structEina__Future}{Eina\+\_\+\+Future}} that is part of the chain that uses an \mbox{\hyperlink{structEina__Promise}{Eina\+\_\+\+Promise}}, that will cancel the whole chain and then the promise.

It should stop all asynchronous operations or at least mark them to be discarded instead of resolved. Actually it can\textquotesingle{}t be resolved once canceled since the given pointer {\ttfamily dead\+\_\+promise} is now invalid.

\begin{DoxyNote}{Note}
\begin{DoxyItemize}
\item This callback is {\bfseries{mandatory}} for a reason, do not provide an empty callback as it\textquotesingle{}ll likely result in memory corruption and invalid access. If impossible to cancel an asynchronous task, then create an intermediate memory to hold \mbox{\hyperlink{structEina__Promise}{Eina\+\_\+\+Promise}} and make it {\ttfamily NULL}, in this callback. Then prior to resolution check if the pointer is set.\end{DoxyItemize}


\begin{DoxyItemize}
\item This callback is {\bfseries{not}} called if \mbox{\hyperlink{group__Eina__Promise_gab5d3ac1b6d4e58a1da5d9e14b77f4c97}{eina\+\_\+promise\+\_\+resolve()}} or \mbox{\hyperlink{group__Eina__Promise_ga215b6ba47e18087e2bd99b87312ff393}{eina\+\_\+promise\+\_\+reject()}} are used. If any cleanup is needed, then call yourself. It\textquotesingle{}s only meant as cancellation, not a general \char`\"{}free callback\char`\"{}.\end{DoxyItemize}

\end{DoxyNote}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em data} & The data provided by the user. \\
\hline
\mbox{\texttt{ in}}  & {\em dead\+\_\+promise} & The canceled promise. \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Promise_ga215b6ba47e18087e2bd99b87312ff393}{eina\+\_\+promise\+\_\+reject()}} 

\mbox{\hyperlink{group__Eina__Promise_gab5d3ac1b6d4e58a1da5d9e14b77f4c97}{eina\+\_\+promise\+\_\+resolve()}} 

\mbox{\hyperlink{group__Eina__Future_ga6d7a6889b5f1a9fca02f868c484148e7}{eina\+\_\+future\+\_\+cancel()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__Eina__Future__Callbacks_ga9dfebda67e96766ede62d657c1991655}\label{group__Eina__Future__Callbacks_ga9dfebda67e96766ede62d657c1991655}} 
\index{Eina Future Callbacks@{Eina Future Callbacks}!Eina\_Future\_Success\_Cb@{Eina\_Future\_Success\_Cb}}
\index{Eina\_Future\_Success\_Cb@{Eina\_Future\_Success\_Cb}!Eina Future Callbacks@{Eina Future Callbacks}}
\doxysubsubsection{\texorpdfstring{Eina\_Future\_Success\_Cb}{Eina\_Future\_Success\_Cb}}
{\footnotesize\ttfamily Eina\+\_\+\+Future\+\_\+\+Success\+\_\+\+Cb}



A callback used to inform that the future completed with success. 

Unlike \mbox{\hyperlink{group__Eina__Future__Callbacks_ga43d2d4c20a2f7aee2a25ada34a9cc675}{Eina\+\_\+\+Future\+\_\+\+Cb}} this callback is only called if the future operation was successful, this is, no errors occurred ({\ttfamily value} type differs from \mbox{\hyperlink{group__Eina__Value__Group_gace284ef9f3063e831b66f04638c7f465}{EINA\+\_\+\+VALUE\+\_\+\+TYPE\+\_\+\+ERROR}}) and the {\ttfamily value} matches \mbox{\hyperlink{struct__Eina__Future__Cb__Easy__Desc_a5112a2ccff7f8b1c48c242763a948d05}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Easy\+\_\+\+Desc\+::success\+\_\+type}} (if given). In case \mbox{\hyperlink{struct__Eina__Future__Cb__Easy__Desc_a5112a2ccff7f8b1c48c242763a948d05}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Easy\+\_\+\+Desc\+::success\+\_\+type}} was not supplied (it\textquotesingle{}s {\ttfamily NULL}) the {\ttfamily value} type must be checked before using it.

\begin{DoxyNote}{Note}
This function is always called from a safe context (main loop or some platform defined safe context).
\end{DoxyNote}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em data} & The data provided by the user. \\
\hline
\mbox{\texttt{ in}}  & {\em value} & The operation result \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An Eina\+\_\+\+Value to pass to the next \mbox{\hyperlink{structEina__Future}{Eina\+\_\+\+Future}} in the chain (if any). If there is no need to convert the received value, it\textquotesingle{}s {\bfseries{recommended}} to passthrough {\ttfamily value} argument. If you need to convert to a different type or generate a new value, use {\ttfamily \mbox{\hyperlink{group__Eina__Value__Value__Group_gab5c6558b1b8be2ad597d71a765cbf5f6}{eina\+\_\+value\+\_\+setup()}}} on {\bfseries{another}} Eina\+\_\+\+Value and return it. By returning a promise Eina\+\_\+\+Value (\mbox{\hyperlink{group__Eina__Future_ga6151e485fad1e3623c365d11e319d7da}{eina\+\_\+promise\+\_\+as\+\_\+value()}}) the whole chain will wait until the promise is resolved in order to continue its execution. Note that the value contents must survive this function scope, that is, do {\bfseries{not}} use stack allocated blobs, arrays, structures or types that keep references to memory you give. Values will be automatically cleaned up using {\ttfamily \mbox{\hyperlink{group__Eina__Value__Value__Group_ga940660709a2862bafac92f47bb721a68}{eina\+\_\+value\+\_\+flush()}}} once they are unused (no more future or futures returned a new value). 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Future_gaacfe9df476304cd36069907863bf12cc}{eina\+\_\+future\+\_\+cb\+\_\+easy\+\_\+from\+\_\+desc()}} 

\mbox{\hyperlink{group__Eina__Future_ga57f56d13f3f3bb13651ea3b81b59e8f1}{eina\+\_\+future\+\_\+cb\+\_\+easy()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__Eina__Future__Callbacks_ga88b867eea465fb367d4974d9cf8d3866}\label{group__Eina__Future__Callbacks_ga88b867eea465fb367d4974d9cf8d3866}} 
\index{Eina Future Callbacks@{Eina Future Callbacks}!Eina\_Future\_Error\_Cb@{Eina\_Future\_Error\_Cb}}
\index{Eina\_Future\_Error\_Cb@{Eina\_Future\_Error\_Cb}!Eina Future Callbacks@{Eina Future Callbacks}}
\doxysubsubsection{\texorpdfstring{Eina\_Future\_Error\_Cb}{Eina\_Future\_Error\_Cb}}
{\footnotesize\ttfamily Eina\+\_\+\+Future\+\_\+\+Error\+\_\+\+Cb}



A callback used to inform that the future completed with failure. 

Unlike \mbox{\hyperlink{group__Eina__Future__Callbacks_ga9dfebda67e96766ede62d657c1991655}{Eina\+\_\+\+Future\+\_\+\+Success\+\_\+\+Cb}} this function is only called when an error occurs during the future process or when \mbox{\hyperlink{struct__Eina__Future__Cb__Easy__Desc_a5112a2ccff7f8b1c48c242763a948d05}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Cb\+\_\+\+Easy\+\_\+\+Desc\+::success\+\_\+type}} differs from the future result. On future creation errors and future cancellation this function will be called from the current context with the following errors\+: {\ttfamily EINVAL}, {\ttfamily ENOMEM} and {\ttfamily ECANCELED}. Otherwise this function is called from a safe context.

If it was possible to recover from an error this function should return an empty value \mbox{\hyperlink{group__Eina__Value__Group_ga06540fbaf4a53dd90133deb813d4f102}{EINA\+\_\+\+VALUE\+\_\+\+EMPTY}} or any other \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} type that differs from \mbox{\hyperlink{group__Eina__Value__Group_gace284ef9f3063e831b66f04638c7f465}{EINA\+\_\+\+VALUE\+\_\+\+TYPE\+\_\+\+ERROR}}. In this case the error will not be reported by the other futures in the chain (if any), otherwise if an \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} type \mbox{\hyperlink{group__Eina__Value__Group_gace284ef9f3063e831b66f04638c7f465}{EINA\+\_\+\+VALUE\+\_\+\+TYPE\+\_\+\+ERROR}} is returned the error will continue to be reported to the other futures in the chain.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em data} & The data provided by the user. \\
\hline
\mbox{\texttt{ in}}  & {\em error} & The operation error \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An \mbox{\hyperlink{group__Eina__Value__Group_ga7985e8af6e956ae31b381bf829173cc0}{Eina\+\_\+\+Value}} to pass to the next \mbox{\hyperlink{structEina__Future}{Eina\+\_\+\+Future}} in the chain (if any). If you need to convert to a different type or generate a new value, use \mbox{\hyperlink{group__Eina__Value__Value__Group_gab5c6558b1b8be2ad597d71a765cbf5f6}{eina\+\_\+value\+\_\+setup()}} on {\bfseries{another}} Eina\+\_\+\+Value and return it. By returning a promise Eina\+\_\+\+Value (\mbox{\hyperlink{group__Eina__Future_ga6151e485fad1e3623c365d11e319d7da}{eina\+\_\+promise\+\_\+as\+\_\+value()}}) the whole chain will wait until the promise is resolved in order to continue its execution. Note that the value contents must survive this function scope, that is, do {\bfseries{not}} use stack allocated blobs, arrays, structures or types that keep references to memory you give. Values will be automatically cleaned up using \mbox{\hyperlink{group__Eina__Value__Value__Group_ga940660709a2862bafac92f47bb721a68}{eina\+\_\+value\+\_\+flush()}} once they are unused (no more future or futures returned a new value). 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Future_gaacfe9df476304cd36069907863bf12cc}{eina\+\_\+future\+\_\+cb\+\_\+easy\+\_\+from\+\_\+desc()}} 

\mbox{\hyperlink{group__Eina__Future_ga57f56d13f3f3bb13651ea3b81b59e8f1}{eina\+\_\+future\+\_\+cb\+\_\+easy()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__Eina__Future__Callbacks_ga3e4a9200b8e67906bf1b1514bc0d93ff}\label{group__Eina__Future__Callbacks_ga3e4a9200b8e67906bf1b1514bc0d93ff}} 
\index{Eina Future Callbacks@{Eina Future Callbacks}!Eina\_Future\_Free\_Cb@{Eina\_Future\_Free\_Cb}}
\index{Eina\_Future\_Free\_Cb@{Eina\_Future\_Free\_Cb}!Eina Future Callbacks@{Eina Future Callbacks}}
\doxysubsubsection{\texorpdfstring{Eina\_Future\_Free\_Cb}{Eina\_Future\_Free\_Cb}}
{\footnotesize\ttfamily Eina\+\_\+\+Future\+\_\+\+Free\+\_\+\+Cb}



A callback used to inform that the future was freed and the user should also {\ttfamily free} the {\ttfamily data}. 

This callback may be called from an unsafe context if the future was canceled or an error occurred.

\begin{DoxyNote}{Note}
This callback is always called, even if \mbox{\hyperlink{group__Eina__Future__Callbacks_ga88b867eea465fb367d4974d9cf8d3866}{Eina\+\_\+\+Future\+\_\+\+Error\+\_\+\+Cb}} and/or \mbox{\hyperlink{group__Eina__Future__Callbacks_ga9dfebda67e96766ede62d657c1991655}{Eina\+\_\+\+Future\+\_\+\+Success\+\_\+\+Cb}} were not provided, which can also be used to monitor when a future ends.
\end{DoxyNote}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em data} & The data provided by the user. \\
\hline
\mbox{\texttt{ in}}  & {\em dead\+\_\+future} & The future that was freed.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Future_gaacfe9df476304cd36069907863bf12cc}{eina\+\_\+future\+\_\+cb\+\_\+easy\+\_\+from\+\_\+desc()}} 

\mbox{\hyperlink{group__Eina__Future_ga57f56d13f3f3bb13651ea3b81b59e8f1}{eina\+\_\+future\+\_\+cb\+\_\+easy()}} 
\end{DoxySeeAlso}
