diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-09-01 23:22:21 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-09-01 23:22:21 +0100 |
| commit | c97b00e17c066e41256569486d0b7902c766dce5 (patch) | |
| tree | 2b10a8c95150d0c5a7ad1d8084632bf3bfd59a9d | |
| parent | a6238f41cf1a96e8d1ee995b42222525eb201e81 (diff) | |
| download | rabbitmq-server-git-c97b00e17c066e41256569486d0b7902c766dce5.tar.gz | |
specs for rabbit_file_handle_cache
| -rw-r--r-- | src/rabbit_file_handle_cache.erl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/rabbit_file_handle_cache.erl b/src/rabbit_file_handle_cache.erl index 83acffd03e..7cc2ed90da 100644 --- a/src/rabbit_file_handle_cache.erl +++ b/src/rabbit_file_handle_cache.erl @@ -40,6 +40,27 @@ mode %% the mode to open the files as }). +%%---------------------------------------------------------------------------- + +-ifdef(use_specs). + +-type(hcstate() :: #hcstate { limit :: non_neg_integer(), + handles :: dict(), + ages :: gb_tree(), + mode :: [any()] + }). + +-spec(init/2 :: (non_neg_integer(), [any()]) -> hcstate()). +-spec(close_all/1 :: (hcstate()) -> hcstate()). +-spec(close_file/2 :: (any(), hcstate()) -> hcstate()). +-spec(with_file_handle_at/4 :: (any(), non_neg_integer(), + fun ((any()) -> {non_neg_integer(), A}), + hcstate()) -> + {A, hcstate()}). +-endif. + +%%---------------------------------------------------------------------------- + init(Limit, OpenMode) -> #hcstate { limit = Limit, handles = dict:new(), |
