Attributes
| context | [R] |
the execution context (fiber) this request was sent on. |
Public Class methods
new(*)
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 45 def initialize(*) 46 super 47 @context = nil 48 end
Public Instance methods
complete!(response = @response)
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 60 def complete!(response = @response) 61 @context = nil 62 super 63 end
current_context?()
checks whether the current execution context is the one where the request was created.
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 56 def current_context? 57 @context == Fiber.current 58 end
set_context!()
sets the execution context for this request. the default is the current fiber.
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 51 def set_context! 52 @context ||= Fiber.current # rubocop:disable Naming/MemoizedInstanceVariableName 53 end