Class: RFuzz::Notifier
- Inherits:
-
Object
- Object
- RFuzz::Notifier
- Defined in:
- lib/rfuzz/client.rb
Overview
This simple class can be registered with an HttpClient and it’ll get called when different parts of the HTTP request happen. Each function represents a different event, and the state parameter is a symbol of consisting of:
:begins -- event begins.
:error -- event caused exception.
:ends -- event finished (not called if error).
These calls are made synchronously so you can throttle the client by sleeping inside them and can track timing data.
Instance Method Summary collapse
-
#close(state) ⇒ Object
Before and after the client closes with the server.
-
#connect(state) ⇒ Object
Fired right before connecting and right after the connection.
-
#read_body(state) ⇒ Object
Before and after the body is ready.
-
#read_header(state) ⇒ Object
Before and after the header is finally read.
-
#redirect(state) ⇒ Object
Called whenever a HttpClient.redirect is done and there are redirects to follow.
-
#send_request(state) ⇒ Object
Before and after the full request is actually sent.
Instance Method Details
#close(state) ⇒ Object
Before and after the client closes with the server.
495 496 |
# File 'lib/rfuzz/client.rb', line 495 def close(state) end |
#connect(state) ⇒ Object
Fired right before connecting and right after the connection.
471 472 |
# File 'lib/rfuzz/client.rb', line 471 def connect(state) end |
#read_body(state) ⇒ Object
Before and after the body is ready.
491 492 |
# File 'lib/rfuzz/client.rb', line 491 def read_body(state) end |
#read_header(state) ⇒ Object
Before and after the header is finally read.
487 488 |
# File 'lib/rfuzz/client.rb', line 487 def read_header(state) end |
#redirect(state) ⇒ Object
Called whenever a HttpClient.redirect is done and there are redirects to follow. You can use a notifier to detect that you’re doing to many and throw an abort.
483 484 |
# File 'lib/rfuzz/client.rb', line 483 def redirect(state) end |
#send_request(state) ⇒ Object
Before and after the full request is actually sent. This may become “send_header” and “send_body”, but right now the whole blob is shot out in one chunk for efficiency.
477 478 |
# File 'lib/rfuzz/client.rb', line 477 def send_request(state) end |