File tree Expand file tree Collapse file tree 2 files changed +0
-64
lines changed Expand file tree Collapse file tree 2 files changed +0
-64
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -66,44 +66,6 @@ public function cancel(string $reason = null): self
66
66
return $ this ;
67
67
}
68
68
69
- /**
70
- * @param int $timeout
71
- *
72
- * @return self
73
- */
74
- public function timeout (int $ timeout ): self
75
- {
76
- $ deferred = new Deferred ;
77
- $ resolved = false ;
78
-
79
- $ watcher = Loop::delay ($ timeout , function () use ($ deferred , &$ resolved ) {
80
- if ($ resolved ) {
81
- return ;
82
- }
83
-
84
- $ resolved = true ;
85
-
86
- $ deferred ->fail (new Exception \ActionTimeout ((string ) $ this ->id ));
87
- });
88
-
89
- $ promise = $ this ->promise ;
90
- $ promise ->onResolve (function () use ($ deferred , $ watcher , &$ resolved ) {
91
- if ($ resolved ) {
92
- return ;
93
- }
94
-
95
- $ resolved = true ;
96
-
97
- Loop::cancel ($ watcher );
98
-
99
- $ deferred ->resolve ($ this ->promise );
100
- });
101
-
102
- $ this ->promise = $ deferred ->promise ();
103
-
104
- return $ this ;
105
- }
106
-
107
69
/**
108
70
* {@inheritdoc}
109
71
*/
You can’t perform that action at this time.
0 commit comments