# `Finitomata.Pool.Actor`
[🔗](https://github.com/am-kantox/finitomata/blob/v0.35.0/lib/finitomata/pool/actor.ex#L1)

The behaviour specifying the actor in the pool.

# `actor`

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

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

# `on_error`
*optional* 

```elixir
@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 `t: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.

# `on_result`
*optional* 

```elixir
@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 `t: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.

# `handler`

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

# `handler`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
