Skip to content

Commit

Permalink
Make IO::Notification::Change a value type
Browse files Browse the repository at this point in the history
Which should make it better to filter for it, e.g. with
Supply.unique(expires => X).
  • Loading branch information
lizmat committed Sep 3, 2020
1 parent 82d5052 commit 17f352f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core.c/IO/Notification.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ my class IO::Notification {
"$.path: $.event";
}
method IO { $!path.IO }

multi method WHICH(Change:D: --> ValueObjAt:D) {
nqp::box_s(
nqp::join('|',nqp::list_s(
self.^name,nqp::substr($!event.Str,4),$!path
)),
ValueObjAt
)
}
}

method watch-path(Str() $path, :$scheduler = $*SCHEDULER) {
Expand Down

0 comments on commit 17f352f

Please sign in to comment.