Skip to main content

stream_account_summary

Function stream_account_summary 

Source
pub async fn stream_account_summary<F>(
    client: &Arc<Client>,
    ib_account: Ustr,
    session_tasks: &TaskGroup,
    on_snapshot: F,
) -> Result<()>
where F: Fn(AccountSnapshot) + Send + 'static,
Expand description

Subscribe to account summary, deliver the first snapshot, and keep the subscription open.

IB repeats the summary about every 3 minutes on a live reqAccountSummary subscription. A session task delivers one further snapshot per refresh cycle through on_snapshot until the subscription ends.

ยงErrors

Returns an error if the subscription fails or the first snapshot cannot be built.