Skip to content

Commit

Permalink
Fix build, META6 and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
atroxaper committed Jul 30, 2018
1 parent c39cee2 commit fe0c85b
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 42 deletions.
38 changes: 26 additions & 12 deletions META6.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
{
"perl" : "6.*",
"name" : "Propius",
"version" : "0.1.0",
"description" : "Memory cache with loader and eviction by time.",
"author" : [ "Mikhail Khorkov" ],
"license" : "Artistic-2.0",
"provides" : {
"Propius" : "lib/Propius.pm6"
},
"depends" : [ "TimeUnit", "OO::Monitors" ],
"tags": [ "cache" ],
"source-url" : "git://github.com/atroxaper/p6-Propius.git"
"perl": "6.c",
"name": "Propius",
"auth": "github:atroxaper",
"api": "1",
"version": "0.1.1",
"description": "Memory cache with loader and eviction by time.",
"authors": [
"Mikhail Khorkov"
],
"license": "Artistic-2.0",
"provides": {
"Propius": "lib/Propius.pm6",
"Propius::Linked": "lib/Propius/Linked.pm6"
},
"depends": [
"TimeUnit",
"OO::Monitors"
],
"build-depends": [],
"test-depends": [],
"resources": [],
"tags": [
"cache",
"eviction"
],
"source-url": "git://github.com/atroxaper/p6-Propius.git"
}
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,30 @@ Create
You can use sub `eviction-based-cache` for creation the new cache.
Arguments are:

`:&loader! where .signature ~~ :(:$key)` - sub with signature like (:$key).
`:&loader! where .signature ~~ :(:$key)` - sub with signature like `(:$key)`.
The sub will be used for producing the new values. Obligatory argument.

`:&removal-listener where .signature ~~ :(:$key, :$value, :$cause)` -
sub with signature like (:$key, :$value, :$cause).
sub with signature like `(:$key, :$value, :$cause)`.
The sub will be called in case when value removed from the cache.
Cause is element of enum RemoveCause.
Cause is element of enum `RemoveCause`.

`:$expire-after-write` - how long the cache have to store value after its last re/write

`:$expire-after-access` - how long the cache have to store value after its last access (read or write)

`:$time-unit` - object of TimeUnit, indicate time unit of expire-after-write/access value.
seconds by default.
`:$time-unit` - object of `TimeUnit`, indicate time unit of expire-after-write/access value.
Seconds by default.

`:$ticker` - object of Ticker, witch is used for retrieve 'current' time.
Can be specified for overriding standard behaviour (current system time),for example for testing.
`:$ticker` - object of `Ticker`, witch is used for retrieve 'current' time.
Can be specified for overriding standard behaviour (current system time), for example for testing.

`:$size` - max capacity of the cache.

Notes
-----

The cache can use object keys. If you want that you have to control .WHICH method if keys.
The cache can use object keys. If you want that you have to control .WHICH method of keys.

Of course the cache is thread-save. It simply uses OO::Monitors for synchronisation.

Expand Down Expand Up @@ -124,7 +124,7 @@ This method may be invoked directly by user.
The method invoked on each write operation and ones for several read operation
if there was no write operation recently.

It means that evicted values will be removed on just in time of its eviction.
It means that evicted values will not be removed on just in time of its eviction.
This is done for the purpose of optimisation - is it not requires special thread
for checking an eviction. If it is issue for you then you can call it method yourself
by some scheduled Promise for example.
Expand Down
2 changes: 0 additions & 2 deletions lib/Propius.pm6
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env perl6

unit module Propius;

use OO::Monitors;
Expand Down
4 changes: 0 additions & 4 deletions lib/Propius/Linked.pm6
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#!/usr/bin/env perl6

use v6;

unit module Propius::Linked;

class Node {
Expand Down
3 changes: 0 additions & 3 deletions t/chain-00-simple.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env perl6

use v6;
use Test;
use lib 'lib';
use Propius::Linked;
Expand Down
3 changes: 0 additions & 3 deletions t/meta-00.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env perl6

use v6;
use Test;
use lib 'lib';

Expand Down
3 changes: 0 additions & 3 deletions t/time-based-00-simple.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env perl6

use v6;
use Test;
use lib 'lib';
use Propius;
Expand Down
3 changes: 0 additions & 3 deletions t/time-based-01-size-eviction.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env perl6

use v6;
use Test;
use lib 'lib';
use Propius;
Expand Down
3 changes: 0 additions & 3 deletions t/time-based-02-time-eviction.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env perl6

use v6;
use Test;
use TimeUnit;
use lib 'lib';
Expand Down

0 comments on commit fe0c85b

Please sign in to comment.