Skip to content

Latest commit

 

History

History
49 lines (29 loc) · 3.48 KB

File metadata and controls

49 lines (29 loc) · 3.48 KB
graph LR
    Consumer["Consumer"]
    RequestSender["RequestSender"]
    FatalError["FatalError"]
    Consumer -- "initiates" --> RequestSender
    Consumer -- "batches data for" --> RequestSender
    RequestSender -- "raises" --> FatalError
Loading

CodeBoardingDemoContact

Component Details

The Event Processor subsystem, primarily driven by the Consumer component, continuously processes and uploads collected analytics events. The Consumer retrieves batches from an event queue, prepares them, and then utilizes the RequestSender to initiate requests to the analytics service. The RequestSender handles the actual HTTP communication, including retry mechanisms and error handling, and can raise a FatalError to indicate unrecoverable issues, preventing further retries for a given operation.

Consumer

The Consumer component is a daemon thread that continuously retrieves analytics events from a queue, batches them according to size and time limits, and initiates the upload process to the Segment API. It handles error reporting and manages retries for failed uploads.

Related Classes/Methods:

RequestSender

The RequestSender component, encapsulated within the Consumer's request method, is responsible for executing the actual HTTP POST request to the Segment API. It implements a retry mechanism with exponential backoff for transient network or API errors and defines specific conditions under which an exception is considered fatal, preventing further retries.

Related Classes/Methods:

  • analytics.consumer.Consumer.request.send_request (full file reference)

FatalError

The FatalError component represents an exception type that signifies an unrecoverable error during the event processing and upload. When this error is raised, the system should not attempt further retries for the current operation.

Related Classes/Methods: