PartitionPump Class

Manages individual connection to a given partition.

Inheritance
builtins.object
PartitionPump

Constructor

PartitionPump(host, lease)

Parameters

host
lease

Methods

close_async

Safely closes the pump.

is_closing

Returns whether pump is closing.

on_closing_async

Event handler for on closing event.

on_open_async

Event handler for on open event.

open_async

Opens partition pump.

process_error_async

Passes error to the event processor for processing.

process_events_async

Process pump events.

run

Makes pump sync so that it can be run in a thread.

set_lease

Sets a new partition lease to be processed by the pump.

set_pump_status

Updates pump status and logs update to console.

close_async

Safely closes the pump.

async close_async(reason)

Parameters

reason
str
Required

The reason for the shutdown.

is_closing

Returns whether pump is closing.

is_closing()

Return type

on_closing_async

Event handler for on closing event.

abstract async on_closing_async(reason)

Parameters

reason
str
Required

The reason for the shutdown.

on_open_async

Event handler for on open event.

abstract async on_open_async()

open_async

Opens partition pump.

async open_async()

process_error_async

Passes error to the event processor for processing.

async process_error_async(error)

Parameters

error
Exception
Required

An error the occurred.

process_events_async

Process pump events.

async process_events_async(events)

Parameters

events
list[EventData]
Required

List of events to be processed.

run

Makes pump sync so that it can be run in a thread.

run()

set_lease

Sets a new partition lease to be processed by the pump.

set_lease(new_lease)

Parameters

lease
Lease
Required

The lease to set.

set_pump_status

Updates pump status and logs update to console.

set_pump_status(status)

Parameters

status
Required