[erlang-questions] enif_schedule_nif return

Sverker Eriksson sverker.eriksson@REDACTED
Tue Apr 12 11:55:52 CEST 2016


On 04/12/2016 10:40 AM, Benoit Chesneau wrote:
> I'm not sure to understand what can I expect from the return of 
> enif_schedule_nif. The doc says:
>
>     Be aware that enif_schedule_nif, as its name implies, only 
> schedules the NIF for future execution. The calling NIF does not block 
> waiting for the scheduled NIF to execute and return, which means that 
> the calling NIF can't expect to receive the scheduled NIF return value 
> and use it for further operations.
>
> So should I handle to return the data asynchronously to the calling 
> process using enf_send? In that case what is the return of the function?
>
>
No. The return value of your scheduled function
will be the return value from your original Erlang nif call.


/Sverker, Erlang/OTP




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160412/b3bf0302/attachment.htm>


More information about the erlang-questions mailing list