Class: Phronomy::Runtime::ThreadScheduler Private
- Defined in:
- lib/phronomy/runtime/thread_scheduler.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Thread-based scheduler: spawns each task in a new OS thread.
This is the default scheduler used by Phronomy::Runtime in production. It delegates directly to Task.spawn with the default Task::ThreadBackend, preserving the pre-282 behaviour exactly.
Constant Summary
Constants inherited from Scheduler
Instance Method Summary collapse
-
#spawn(name:, parent:, &block) ⇒ Task
private
Spawns +block+ as a new Task backed by a Thread.
-
#yield ⇒ void
private
Yields the current thread's time slice to other runnable threads.
Methods inherited from Scheduler
current, #new_signal, #raise_signal, #raise_signal_all, #wait_for_signal
Instance Method Details
#spawn(name:, parent:, &block) ⇒ Task
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Spawns +block+ as a new Task backed by a Thread.
18 19 20 |
# File 'lib/phronomy/runtime/thread_scheduler.rb', line 18 def spawn(name:, parent:, &block) Task.spawn(name: name, parent: parent, &block) end |
#yield ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Yields the current thread's time slice to other runnable threads.
25 26 27 |
# File 'lib/phronomy/runtime/thread_scheduler.rb', line 25 def yield Thread.pass end |