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.

Since:

  • 0.5.0

Instance Method Summary collapse

Instance Method Details

#abortObject

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.

Examples:

Abort hydra.

hydra.abort

Since:

  • 0.5.0



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.

Examples:

Queue request.

hydra.queue(request)

Since:

  • 0.5.0



38
39
40
41
# File 'lib/typhoeus/hydra/queueable.rb', line 38

def queue(request)
  request.hydra = self
  queued_requests << request
end

#queued_requestsArray<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.

Examples:

Return queued requests.

hydra.queued_requests

Returns:

Since:

  • 0.5.0



16
17
18
# File 'lib/typhoeus/hydra/queueable.rb', line 16

def queued_requests
  @queued_requests ||= []
end