agala v2.5.2 Agala

Main framework module. Basic Application. Should be started as external application in your mix.exs file in order to use Agala.

Link to this section Summary

Functions

This method provides functionality to send request and get response to bot responser's provider. You can use it in order to call method out of request-response cycle. For example - to get additional parameters from provider's entity.

Gets the value, stored under the given key across bot's supervisor lifetime. Can be usefull to reveal some state across restarting handlers, responsers and receivers.

Function in the global scope. Starts the navigation process of the response. Calling this function will send the response to nesessery bot across the cluster.

Sets given value under given key across bot's supervisor lifetime. Can be usefull to store some state across restarting handlers, responsers and receivers.

Link to this section Functions

Link to this function

execute(fun, bot_params)
execute(fun :: (Agala.Conn.t() -> any()), bot_params :: Agala.BotParams.t()) ::
  any()

This method provides functionality to send request and get response to bot responser's provider. You can use it in order to call method out of request-response cycle. For example - to get additional parameters from provider's entity.

Examples

Agala.execute(fn conn -> Users.get(conn, user_ids, fields, name_case) end, bot_params)
Link to this function

get(bot_params, key)

Gets the value, stored under the given key across bot's supervisor lifetime. Can be usefull to reveal some state across restarting handlers, responsers and receivers.

Link to this function

response_with(conn)
response_with(conn :: Agala.Conn.t()) :: :ok

Function in the global scope. Starts the navigation process of the response. Calling this function will send the response to nesessery bot across the cluster.

Handler's response is automaticly casted to this function.

Params

  • conn - Agala.Conn with populated Agala.Conn.Response.
Link to this function

set(bot_params, key, value)

Sets given value under given key across bot's supervisor lifetime. Can be usefull to store some state across restarting handlers, responsers and receivers.