user_manager v0.2.0 UserManager.Notifications.NotificationRequestInitiator

receives requests to subscribe to a static notification

Summary

Functions

get subscribers for a particular workflow/workflow_response_code

list of workflows and the codes that notifications can be configured for

register a subscriber (pid) to revieve process.send events from the notification service

Functions

get_subscribers(workflow, workflow_response_code)

get subscribers for a particular workflow/workflow_response_code

## Examples

iex>{:ok, _} = UserManager.Notifications.NotificationRequestInitiator.register_static_notification(:create_user, :validation_error, self())
iex>Enum.count(UserManager.Notifications.NotificationRequestInitiator.get_subscribers(:create_user, :validation_error)) == 1
true

iex>Enum.count(UserManager.Notifications.NotificationRequestInitiator.get_subscribers(:create_user, :not_found)) == 0
true
get_workflow_and_codes_map()

list of workflows and the codes that notifications can be configured for

register_static_notification(workflow, workflow_response_code, notification_response_pid)

register a subscriber (pid) to revieve process.send events from the notification service

## Attributes

  • workflow - the workflow to subscibe to
  • workflow_response_code - the workfow code to subscibe to

    ## Examples iex>{:ok, response} = UserManager.Notifications.NotificationRequestInitiator.registerstatic_notification(:create_user, :validation_error, self()) iex>{:notify_sub, w, tag, } = response iex>w :create_user iex>tag :validation_error

    iex>UserManager.Notifications.NotificationRequestInitiator.register_static_notification(:never_find_me, :success, self())

    iex>UserManager.Notifications.NotificationRequestInitiator.register_static_notification(:create_user, :not_found_me_ever_never, self())

    iex>UserManager.Notifications.NotificationRequestInitiator.register_static_notification(:create_user, :success, nil)

start_link(state, opts)