From f9d1055f28434bebcc9789e5b5a34f0384b02ada Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Thu, 24 Jul 2025 20:01:14 +1200 Subject: [PATCH] Forward `**options` in `raise`. --- examples/scheduler/scheduler.rb | 4 ++-- lib/io/event/debug/selector.rb | 4 ++-- lib/io/event/selector/select.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/scheduler/scheduler.rb b/examples/scheduler/scheduler.rb index 2aa878db..0dd7cd73 100644 --- a/examples/scheduler/scheduler.rb +++ b/examples/scheduler/scheduler.rb @@ -58,8 +58,8 @@ def push(fiber) @selector.push(fiber) end - def raise(*arguments) - @selector.raise(*arguments) + def raise(*arguments, **options) + @selector.raise(*arguments, **options) end def resume(fiber, *arguments) diff --git a/lib/io/event/debug/selector.rb b/lib/io/event/debug/selector.rb index 8fe4fbfe..1444667a 100644 --- a/lib/io/event/debug/selector.rb +++ b/lib/io/event/debug/selector.rb @@ -116,9 +116,9 @@ def push(fiber) # # @parameter fiber [Fiber] The fiber to raise the exception on. # @parameter arguments [Array] The arguments to use when raising the exception. - def raise(fiber, *arguments) + def raise(fiber, *arguments, **options) log("Raising exception on fiber #{fiber.inspect} with #{arguments.inspect}") - @selector.raise(fiber, *arguments) + @selector.raise(fiber, *arguments, **options) end # Check if the selector is ready. diff --git a/lib/io/event/selector/select.rb b/lib/io/event/selector/select.rb index 2c7caec4..ee411caa 100644 --- a/lib/io/event/selector/select.rb +++ b/lib/io/event/selector/select.rb @@ -98,11 +98,11 @@ def push(fiber) end # Transfer to the given fiber and raise an exception. Put the current fiber into the ready list. - def raise(fiber, *arguments) + def raise(fiber, *arguments, **options) optional = Optional.new(Fiber.current) @ready.push(optional) - fiber.raise(*arguments) + fiber.raise(*arguments, **options) ensure optional.nullify end