module Typhoeus::Request::Callbacks

This module contains the logic for the response callbacks.

You can set multiple callbacks, which are then executed in the same order.

request.on_complete { |response| p 1 }
request.on_complete { |response| p 2 }
request.execute_callbacks
#=> 1
#=> 2

You can clear the callbacks:

request.on_complete { |response| p 1 }
request.on_complete { |response| p 2 }
request.on_complete.clear
request.execute_callbacks
#=> nil

@note If you’re using the Hydra to execute multiple

requests, then callbacks are delaying the
request execution.