We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
FiberError
#stop
1 parent 6f02d33 commit 3e993bcCopy full SHA for 3e993bc
spec/async/task_spec.rb
@@ -305,6 +305,26 @@
305
expect(child_task).to_not be_alive
306
end
307
308
+
309
+ it "can stop a currently resumed task" do
310
+ parent_task = nil
311
312
+ reactor.run do
313
+ reactor.async do |task|
314
+ parent_task = task
315
316
+ Fiber.new do
317
+ task.async do
318
+ parent_task.stop
319
+ end
320
+ end.resume
321
322
+ task.sleep(1)
323
324
325
326
+ expect(parent_task).to be_stopped
327
328
329
it "can stop nested parent" do
330
parent_task = nil
0 commit comments