otp_types.hrl 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. %% shorter definitions for gen_server and supervisor callback types
  2. -type(gs_args() :: term()).
  3. -type(gs_state() :: term()).
  4. -type(gs_reason() :: term()).
  5. -type(gs_start_link_reply() :: {ok, pid()} | ignore | {error, term()}).
  6. -type(gs_init_reply() ::
  7. {ok, gs_state()} | {ok, gs_state(), timeout() | hibernate} |
  8. {stop, gs_reason()} | ignore).
  9. -type(gs_request() :: term()).
  10. -type(gs_from() :: {pid(), term()}).
  11. -type(gs_reply() :: term()).
  12. -type(gs_call_reply() ::
  13. {reply, gs_reply(), gs_state()} |
  14. {reply, gs_reply(), gs_state(), timeout() | hibernate} |
  15. {noreply, gs_state()} |
  16. {noreply, gs_state(), timeout() | hibernate} |
  17. {stop, gs_reason(), gs_reply(), gs_state()} |
  18. {stop, gs_reason(), gs_state()}).
  19. -type(gs_cast_reply() ::
  20. {noreply, gs_state()} |
  21. {noreply, gs_state(), timeout() | hibernate} |
  22. {stop, gs_reason(), gs_state()}).
  23. -type(gs_info_reply() ::
  24. {noreply, gs_state()} |
  25. {noreply, gs_state(), timeout() | hibernate} |
  26. {stop, gs_reason(), gs_state()}).
  27. -type(terminate_reason() :: normal | shutdown | {shutdown, term()} | term()).
  28. -type(gs_code_change_reply() ::
  29. {ok, gs_state()} | {error, gs_reason()}).
  30. -type(sup_init_reply() ::
  31. {ok, {{supervisor:strategy(), non_neg_integer(), non_neg_integer()},
  32. [supervisor:child_spec()]}}
  33. | ignore).