Class: ClaudeAgentSDK::FiberBoundary::SchedulingScope Private
- Inherits:
-
Object
- Object
- ClaudeAgentSDK::FiberBoundary::SchedulingScope
- Defined in:
- lib/claude_agent_sdk/fiber_boundary.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.
The value stored under SCHEDULING_KEY: a closable carrier rather than a bare symbol. Fiber-storage inheritance copies the storage HASH but shares value REFERENCES, so every fiber (and thread) created during a dispatch inherits this same object. Restoring the dispatching fiber's own slot is therefore not enough — a child task spawned inside a handler that outlives the dispatch would keep reading the stale mode forever. Closing the scope in the dispatch's ensure invalidates it for ALL inheritors at once; readers fall back to the server's own default. Benign race on close vs. a concurrent reader: either value is a defensible mode for a call that straddles the dispatch boundary.
Instance Attribute Summary collapse
- #mode ⇒ Object readonly private
Instance Method Summary collapse
- #active? ⇒ Boolean private
- #close ⇒ Object private
-
#initialize(mode) ⇒ SchedulingScope
constructor
private
A new instance of SchedulingScope.
Constructor Details
#initialize(mode) ⇒ SchedulingScope
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.
Returns a new instance of SchedulingScope.
104 105 106 107 |
# File 'lib/claude_agent_sdk/fiber_boundary.rb', line 104 def initialize(mode) @mode = mode @active = true end |
Instance Attribute Details
#mode ⇒ Object (readonly)
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.
102 103 104 |
# File 'lib/claude_agent_sdk/fiber_boundary.rb', line 102 def mode @mode end |
Instance Method Details
#active? ⇒ Boolean
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.
109 110 111 |
# File 'lib/claude_agent_sdk/fiber_boundary.rb', line 109 def active? @active end |
#close ⇒ Object
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.
113 114 115 |
# File 'lib/claude_agent_sdk/fiber_boundary.rb', line 113 def close @active = false end |