Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Cache/Async.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ method !expire-by-age($now) {

In order to get items from, or better through, the cache, the B<get()> method is used:

get($key, +@args --> Promise) {
get($key, |args --> Promise) {

The first argument is the B<$key> used to look up items in the cache, and is passed
through to the producer function the cache uses. Any other arguments are also passed
Expand All @@ -183,7 +183,7 @@ and simply return the promise from the producer directly.

=end pod

method get($key, +@args --> Promise) {
method get($key, |args --> Promise) {
my $entry;
my $now = Nil;
$!lock.protect({
Expand All @@ -206,7 +206,7 @@ method get($key, +@args --> Promise) {
self!link($entry);
$entry.promise = Promise.new;
my $producer-promise = Promise.start({
my $prod-result = &.producer.($key, |@args);
my $prod-result = &.producer.($key, |args);
CATCH {
default: $entry.promise.break($_);
}
Expand Down Expand Up @@ -253,7 +253,7 @@ method get($key, +@args --> Promise) {
if ! $entry.is-refreshing {
$entry.is-refreshing = True;
my $refresh-promise = Promise.start({
my $prod-result = &.producer.($key, |@args);
my $prod-result = &.producer.($key, |args);
CATCH {
# ignore, this is just a refresh attempt
# anyway
Expand Down