View Source Finitomata.Pool.Actor behaviour (Finitomata v0.20.2)

The behaviour specifying the actor in the pool.

Summary

Callbacks

The function which would be invoked in Finitomata.Pool.run/3 after actor/2 failed with a failure message and the state of the Pool worker, see Finitomata.Pool.naive_handler/0.

The function which would be invoked in Finitomata.Pool.run/3 after actor/2 returned successfully with a result of invocation and the state of the Pool worker, see Finitomata.Pool.naive_handler/0.

Functions

StreamData helper to produce on_error/2 and on_result/2 handlers

Callbacks

@callback actor(term(), Finitomata.State.payload()) :: {:ok, term()} | {:error, any()}

The function which would be invoked in Finitomata.Pool.run/3, see Finitomata.Pool.responsive_actor/0

Link to this callback

on_error(error, id)

View Source (optional)
@callback on_error(error :: term(), id :: Finitomata.Pool.id()) :: any()

The function which would be invoked in Finitomata.Pool.run/3 after actor/2 failed with a failure message and the state of the Pool worker, see Finitomata.Pool.naive_handler/0.

The value returned from this call will be send as an last argument of the message to the caller of Finitomata.Pool.run/3 if the pid was passed.

Link to this callback

on_result(result, id)

View Source (optional)
@callback on_result(result :: term(), id :: Finitomata.Pool.id()) :: any()

The function which would be invoked in Finitomata.Pool.run/3 after actor/2 returned successfully with a result of invocation and the state of the Pool worker, see Finitomata.Pool.naive_handler/0.

The value returned from this call will be send as an last argument of the message to the caller of Finitomata.Pool.run/3 if the pid was passed.

Functions

StreamData helper to produce on_error/2 and on_result/2 handlers