-
-
Save anonymous/bf8262d50738682cfcb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojo/IOLoop/Delay.pm b/lib/Mojo/IOLoop/Delay.pm | |
index 33f3541..a9fe61a 100644 | |
--- a/lib/Mojo/IOLoop/Delay.pm | |
+++ b/lib/Mojo/IOLoop/Delay.pm | |
@@ -5,9 +5,8 @@ use Mojo::IOLoop; | |
use Mojo::Util; | |
use Hash::Util::FieldHash 'fieldhash'; | |
-has ioloop => sub { Mojo::IOLoop->singleton }; | |
- | |
-fieldhash my %REMAINING; | |
+has ioloop => sub { Mojo::IOLoop->singleton }; | |
+has remaining => sub { [] }; | |
sub begin { | |
my ($self, $offset, $len) = @_; | |
@@ -20,13 +19,6 @@ sub data { Mojo::Util::_stash(data => @_) } | |
sub pass { $_[0]->begin->(@_) } | |
-sub remaining { | |
- my $self = shift; | |
- return $REMAINING{$self} //= [] unless @_; | |
- $REMAINING{$self} = shift; | |
- return $self; | |
-} | |
- | |
sub steps { | |
my $self = shift->remaining([@_]); | |
$self->ioloop->next_tick($self->begin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment