Class: PatientHttp::ProcessorObserver

Inherits:
Object
  • Object
show all
Defined in:
lib/patient_http/processor_observer.rb

Overview

Interface for observing request processing. A process observer can be registered with a Processor and receive events as requests are processed. Observers will run on the main processor thread and so should be lightweight and not do processing other than recording metrics or similar.

Instance Method Summary collapse

Instance Method Details

#capacity_exceededvoid

This method returns an undefined value.

Called when a request cannot be enqueued because the processor is at capacity.



24
25
# File 'lib/patient_http/processor_observer.rb', line 24

def capacity_exceeded
end

#request_end(request_task) ⇒ void

This method returns an undefined value.

Called when a request finishes processing.

Parameters:

  • request_task (RequestTask)

    the request task that ended



38
39
# File 'lib/patient_http/processor_observer.rb', line 38

def request_end(request_task)
end

#request_error(error) ⇒ void

This method returns an undefined value.

Called when a request encounters an error.

Parameters:

  • error (StandardError)

    the error that occurred



45
46
# File 'lib/patient_http/processor_observer.rb', line 45

def request_error(error)
end

#request_start(request_task) ⇒ void

This method returns an undefined value.

Called when a request starts processing.

Parameters:

  • request_task (RequestTask)

    the request task that started



31
32
# File 'lib/patient_http/processor_observer.rb', line 31

def request_start(request_task)
end

#startvoid

This method returns an undefined value.

Called when the processor starts.



12
13
# File 'lib/patient_http/processor_observer.rb', line 12

def start
end

#stopvoid

This method returns an undefined value.

Called when the processor stops.



18
19
# File 'lib/patient_http/processor_observer.rb', line 18

def stop
end