diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2010-08-02 16:56:21 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2010-08-02 16:56:21 +0100 |
| commit | 0eb6880f1d45b51f9ff0c2bec46a9f08ec728232 (patch) | |
| tree | c7d74daea28eb47b41d177024de6617a73476831 /src | |
| parent | d074060b4ebeb366d3bc061effc5073d066431d4 (diff) | |
| download | rabbitmq-server-git-0eb6880f1d45b51f9ff0c2bec46a9f08ec728232.tar.gz | |
Attempt to improve specs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_event.erl | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/rabbit_event.erl b/src/rabbit_event.erl index e2d0094d53..e9406c1245 100644 --- a/src/rabbit_event.erl +++ b/src/rabbit_event.erl @@ -38,17 +38,27 @@ -export([stats_level/1]). -export([notify/2]). --opaque(state() :: {atom(), atom()}). +-ifdef(use_specs). + +-type(level() :: 'none' | 'coarse' | 'fine'). + +-opaque(state() :: #state { + level :: level(), + timer :: atom() + }). + +-type(timer_fun() :: fun (() -> 'ok')). -spec(init_stats_timer/0 :: () -> state()). --spec(ensure_stats_timer/3 :: - (state(), fun (() -> 'ok'), fun (() -> 'ok')) -> state()). --spec(stop_stats_timer/2 :: (state(), fun (() -> 'ok')) -> state()). --spec(ensure_stats_timer_after/2 :: (state(), fun (() -> 'ok')) -> state()). +-spec(ensure_stats_timer/3 :: (state(), timer_fun(), timer_fun()) -> state()). +-spec(stop_stats_timer/2 :: (state(), timer_fun()) -> state()). +-spec(ensure_stats_timer_after/2 :: (state(), timer_fun()) -> state()). -spec(reset_stats_timer_after/1 :: (state()) -> 'ok'). --spec(stats_level/1 :: (state()) -> atom()). +-spec(stats_level/1 :: (state()) -> level()). -spec(notify/2 :: (atom(), term()) -> 'ok'). +-endif. + -record(state, {level, timer}). %%---------------------------------------------------------------------------- |
