Module: Typhoeus::Hydra::Queueable Private
- Included in:
- Typhoeus::Hydra
- Defined in:
- lib/typhoeus/hydra/queueable.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
This module handles the request queueing on hydra.
Instance Method Summary collapse
-
#abort ⇒ Object
private
Abort the current hydra run as good as possible.
-
#queue(request) ⇒ Object
private
Enqueues a request in order to be performed by the hydra.
-
#queued_requests ⇒ Array<Typhoeus::Request>
private
Return the queued requests.
Instance Method Details
#abort ⇒ 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.
Abort the current hydra run as good as possible. This means that it only clears the queued requests and can’t do anything about already running requests.
27 28 29 |
# File 'lib/typhoeus/hydra/queueable.rb', line 27 def abort queued_requests.clear end |
#queue(request) ⇒ 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.
Enqueues a request in order to be performed by the hydra. This can even be done while the hydra is running. Also sets hydra on request.
38 39 40 41 |
# File 'lib/typhoeus/hydra/queueable.rb', line 38 def queue(request) request.hydra = self queued_requests << request end |
#queued_requests ⇒ Array<Typhoeus::Request>
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.
Return the queued requests.
16 17 18 |
# File 'lib/typhoeus/hydra/queueable.rb', line 16 def queued_requests @queued_requests ||= [] end |