pub struct CancelBroadcaster { /* private fields */ }
Expand description
Broadcasts cancel requests to multiple HTTP clients for redundancy.
This broadcaster fans out cancel requests to multiple pre-warmed HTTP clients in parallel, short-circuits when the first successful acknowledgement is received, and handles expected rejection patterns with appropriate log levels.
Implementations§
Source§impl CancelBroadcaster
impl CancelBroadcaster
Sourcepub fn new(config: CancelBroadcasterConfig) -> Result<Self>
pub fn new(config: CancelBroadcasterConfig) -> Result<Self>
Creates a new CancelBroadcaster
with internal HTTP client pool.
§Errors
Returns an error if any HTTP client fails to initialize.
Sourcepub async fn start(&self) -> Result<()>
pub async fn start(&self) -> Result<()>
Starts the broadcaster and health check loop.
§Errors
Returns an error if the broadcaster is already running.
Sourcepub async fn broadcast_cancel(
&self,
instrument_id: InstrumentId,
client_order_id: Option<ClientOrderId>,
venue_order_id: Option<VenueOrderId>,
) -> Result<Option<OrderStatusReport>>
pub async fn broadcast_cancel( &self, instrument_id: InstrumentId, client_order_id: Option<ClientOrderId>, venue_order_id: Option<VenueOrderId>, ) -> Result<Option<OrderStatusReport>>
Broadcasts a single cancel request to all healthy clients in parallel.
§Returns
Ok(Some(report))
if successfully cancelled with a report.Ok(None)
if the order was already cancelled (idempotent success).Err
if all requests failed.
§Errors
Returns an error if all cancel requests fail or no healthy clients are available.
Sourcepub async fn broadcast_batch_cancel(
&self,
instrument_id: InstrumentId,
client_order_ids: Option<Vec<ClientOrderId>>,
venue_order_ids: Option<Vec<VenueOrderId>>,
) -> Result<Vec<OrderStatusReport>>
pub async fn broadcast_batch_cancel( &self, instrument_id: InstrumentId, client_order_ids: Option<Vec<ClientOrderId>>, venue_order_ids: Option<Vec<VenueOrderId>>, ) -> Result<Vec<OrderStatusReport>>
Broadcasts a batch cancel request to all healthy clients in parallel.
§Errors
Returns an error if all cancel requests fail or no healthy clients are available.
Sourcepub async fn broadcast_cancel_all(
&self,
instrument_id: InstrumentId,
order_side: Option<OrderSide>,
) -> Result<Vec<OrderStatusReport>>
pub async fn broadcast_cancel_all( &self, instrument_id: InstrumentId, order_side: Option<OrderSide>, ) -> Result<Vec<OrderStatusReport>>
Broadcasts a cancel all request to all healthy clients in parallel.
§Errors
Returns an error if all cancel requests fail or no healthy clients are available.
Sourcepub fn get_metrics(&self) -> BroadcasterMetrics
pub fn get_metrics(&self) -> BroadcasterMetrics
Gets broadcaster metrics.
Sourcepub async fn get_metrics_async(&self) -> BroadcasterMetrics
pub async fn get_metrics_async(&self) -> BroadcasterMetrics
Gets broadcaster metrics (async version for use within async context).
Sourcepub fn get_client_stats(&self) -> Vec<ClientStats>
pub fn get_client_stats(&self) -> Vec<ClientStats>
Gets per-client statistics.
Sourcepub async fn get_client_stats_async(&self) -> Vec<ClientStats>
pub async fn get_client_stats_async(&self) -> Vec<ClientStats>
Gets per-client statistics (async version for use within async context).
Sourcepub fn add_instrument(&self, instrument: InstrumentAny)
pub fn add_instrument(&self, instrument: InstrumentAny)
Adds an instrument to all HTTP clients in the pool for caching.
pub fn clone_for_async(&self) -> Self
Trait Implementations§
Source§impl Debug for CancelBroadcaster
impl Debug for CancelBroadcaster
Source§impl<'py> IntoPyObject<'py> for CancelBroadcaster
impl<'py> IntoPyObject<'py> for CancelBroadcaster
Source§type Target = CancelBroadcaster
type Target = CancelBroadcaster
Source§type Output = Bound<'py, <CancelBroadcaster as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <CancelBroadcaster as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for CancelBroadcaster
impl PyClass for CancelBroadcaster
Source§impl PyClassImpl for CancelBroadcaster
impl PyClassImpl for CancelBroadcaster
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Broadcasts cancel requests to multiple HTTP clients for redundancy.
///
/// This broadcaster fans out cancel requests to multiple pre-warmed HTTP clients
/// in parallel, short-circuits when the first successful acknowledgement is received,
/// and handles expected rejection patterns with appropriate log levels.
const RAW_DOC: &'static CStr = /// Broadcasts cancel requests to multiple HTTP clients for redundancy. /// /// This broadcaster fans out cancel requests to multiple pre-warmed HTTP clients /// in parallel, short-circuits when the first successful acknowledgement is received, /// and handles expected rejection patterns with appropriate log levels.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature
if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<CancelBroadcaster>
type ThreadChecker = SendablePyClass<CancelBroadcaster>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for CancelBroadcaster
impl PyClassNewTextSignature for CancelBroadcaster
const TEXT_SIGNATURE: &'static str = "(pool_size, api_key=None, api_secret=None, base_url=None, testnet=False, timeout_secs=None, max_retries=None, retry_delay_ms=None, retry_delay_max_ms=None, recv_window_ms=None, max_requests_per_second=None, max_requests_per_minute=None, health_check_interval_secs=30, health_check_timeout_secs=5, expected_reject_patterns=None, idempotent_success_patterns=None)"
Source§impl<'a, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder CancelBroadcaster
impl<'a, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder CancelBroadcaster
Source§impl<'a, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder mut CancelBroadcaster
impl<'a, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder mut CancelBroadcaster
Source§impl PyMethods<CancelBroadcaster> for PyClassImplCollector<CancelBroadcaster>
impl PyMethods<CancelBroadcaster> for PyClassImplCollector<CancelBroadcaster>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for CancelBroadcaster
impl PyTypeInfo for CancelBroadcaster
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type.impl DerefToPyAny for CancelBroadcaster
Auto Trait Implementations§
impl Freeze for CancelBroadcaster
impl !RefUnwindSafe for CancelBroadcaster
impl Send for CancelBroadcaster
impl Sync for CancelBroadcaster
impl Unpin for CancelBroadcaster
impl !UnwindSafe for CancelBroadcaster
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self
into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self
into an owned Python object, dropping type information and unbinding it
from the 'py
lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self
into a Python object. Read more