GenDelegate v1.0.0 GenDelegate

This module provides delegation abilities to a developer in order to expose local functions from within a GenServer.

Summary

Macros

Allows delegation of an internal function to a GenServer interface

Macros

gen_delegate(head, options \\ [])

Allows delegation of an internal function to a GenServer interface.

Delegation should be used when binding a function needed locally against a function which is also needed remotely.

Options

  • :alias - a name to refer to the state as, instead of state.
  • :type - the type of delegate this is. Any of :cast, :call and :info.

Examples

gen_delegate function(var_one, state), type: :cast
gen_delegate function(var_one, state), type: [ :call, :cast ]
gen_delegate function(var_one, names), type: :info, alias: :names