execute_with_long_running_notification

Function execute_with_long_running_notification 

Source
pub async fn execute_with_long_running_notification<F, T>(
    operation_fut: F,
    session: &SessionImpl,
    operation_name: &str,
) -> Result<T>
where F: Future<Output = Result<T>>,
Expand description

Execute an async operation with a notification if it takes too long. This is useful for operations that might be delayed due to high barrier latency.

The notification timeout duration is controlled by the slow_ddl_notification_secs session variable.

§Arguments

  • operation_fut - The async operation to execute
  • session - The session to send notifications to
  • operation_name - The name of the operation for the notification message (e.g., “DROP TABLE”)

§Example

execute_with_long_running_notification(
    catalog_writer.drop_table(source_id, table_id, cascade),
    &session,
    "DROP TABLE",
).await?;