Skip to content

Commit

Permalink
Fix README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
atroxaper committed Oct 13, 2017
1 parent c865ca7 commit f00c782
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ Of course the cache is thread-save. It simply uses OO::Monitors for synchronisat
Available methods
-----------------

###get(Any:D $key)
### get(Any:D $key)
Retrieve value by key.

my $is-primitive = $cache.get(655360001);

If there is no value for specified key then loader with be
used to produce the new value.

###get-if-exists(Any:D $key)
### get-if-exists(Any:D $key)
Retrieve value by key only if it exists.

my $is-primitive = $cache.get-if-exists(900900900900990990990991);

If there is no value for specified key then Any will be returned.

###put(Any:D :$key, Any:D :$value)
###put(Any:D :$key, :&loader! where .signature ~~ :(:$key))
### put(Any:D :$key, Any:D :$value)
### put(Any:D :$key, :&loader! where .signature ~~ :(:$key))
Store a value in cache with/without specified loader.

$cache.put(:900900900900990990990991key, :value);
Expand All @@ -89,9 +89,9 @@ In case of cache already reached max capacity value which has not
been used for a longest time will be removed. In that case
removal-listener will be called with old value cause Size.

###invalidate
###invalidateAll(List:D @keys)
###invalidateAll
### invalidate
### invalidateAll(List:D @keys)
### invalidateAll
Mark value/values for specified/all key/keys as invalidate.

$cache.invalidate(655360001);
Expand All @@ -101,20 +101,20 @@ Mark value/values for specified/all key/keys as invalidate.
The value will be removed and removal-listener will be called for each
old values cause Explicit.

###elems
### elems
Return keys and values stored in cache as Hash.

$cache.elems();
###hash
### hash
Return keys and values stored in cache as Hash.

$cache.hash();
This is a copy of values. Any modification of returned cache will no have
an effect on values in the store.

###clean-up
### clean-up
Clean evicted values from cache.

$cache.clean-up();
Expand Down

0 comments on commit f00c782

Please sign in to comment.