diff options
Diffstat (limited to 'lib/MaildirIndexer/Store.pm6')
-rw-r--r-- | lib/MaildirIndexer/Store.pm6 | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/MaildirIndexer/Store.pm6 b/lib/MaildirIndexer/Store.pm6 index 5c95250..e1f2c5e 100644 --- a/lib/MaildirIndexer/Store.pm6 +++ b/lib/MaildirIndexer/Store.pm6 @@ -1,12 +1,11 @@ use v6.d; unit class MaildirIndexer::Store; use MaildirIndexer::Index; -use MaildirIndexer::ScanDir; use MaildirIndexer::Parser; has Lock $!lock .= new; has MaildirIndexer::Index @.indices is required; -has Str $.maildir is required; +has Channel $.file-channel is required; has Int $.workers = 10; method dump() { @@ -16,12 +15,9 @@ method dump() { } method start() { - my $file-supply = scan-dir($.maildir); - my $file-channel = $file-supply.Channel; - for ^10 { start react { - whenever $file-channel -> $file { + whenever $.file-channel -> $file { if $file.e && $file.f { self.add-file($file); } |