Skip to main content
Full async documentation coming soon. Basic patterns are shown below.

Overview

The Shannon Python SDK provides both synchronous and asynchronous clients. Use async operations for:
  • Concurrent task submission
  • Non-blocking event streaming
  • Parallel API calls
  • High-throughput applications

AsyncShannonClient

Basic Usage

Concurrent Tasks

Submit multiple tasks simultaneously:

Async Streaming

Stream events without blocking. Tip: don’t await other client calls inside the async for loop — break out first, then await:

Timeout Handling

Background Tasks

Run tasks in background while doing other work:

Error Handling

Integration with Web Frameworks

FastAPI Example

To test:

Best Practices

  1. Use context managers (async with) for proper cleanup
  2. Handle timeouts for long-running operations
  3. Implement retry logic for network failures
  4. Use gather() for concurrent operations
  5. Stream events for real-time updates

Next Steps

Examples

More code examples

Error Handling

Robust error handling