View Source Flamel.Task (flamel v1.10.0)

Provides a few convenience functions for common Task use cases Alpha

Summary

Functions

Execute a function asynchronously Alpha

Executes a task in a background process Alpha

Execute a function after a specified delay interval. Alpha

Execute a stream asynchronously Alpha

Functions

@spec async(
  function(),
  keyword()
) :: term()

Execute a function asynchronously Alpha

Examples

ie> task = Flamel.Task.async(fn -> IO.puts("Look at me!") end)
Link to this function

background(func, opts \\ [])

View Source

Executes a task in a background process Alpha

@spec delay(timeout(), function()) :: term()

Execute a function after a specified delay interval. Alpha

Examples

ie> task = Flamel.Task.delay(1_000, fn -> IO.puts("I am 1 second delayed") end)
Link to this function

stream(stream, func, opts \\ [])

View Source

Execute a stream asynchronously Alpha

Examples

ie> task = Flamel.Task.stream(["one", "two"], fn item -> IO.puts(item) end)