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 44 def initialize(*) 45 super 46 @context = nil 47 end
Public Instance methods
complete!(response = @response)
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 59 def complete!(response = @response) 60 @context = nil 61 super 62 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 55 def current_context? 56 @context == Fiber.current 57 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 50 def set_context! 51 @context ||= Fiber.current # rubocop:disable Naming/MemoizedInstanceVariableName 52 end