Skip to main content
When streaming RHEED data, use the polling utilities in atomscale.timeseries to receive analysis updates as they arrive. Four entry points cover different concurrency needs:

Setup

Synchronous polling

Loop over iter_poll to fetch fresh rows on a fixed cadence. The helper waits interval seconds between polls.

Parameters

Background thread polling

Use start_polling_thread when you can’t block the main thread (GUI, acquisition loop):
The function returns a threading.Event that you can set to stop polling gracefully.

Async polling

Two helpers integrate with asyncio:

Async iterator

aiter_poll yields results without blocking the event loop:

Background task

start_polling_task creates a background task that invokes an optional async handler:

Deduplication

The distinct_by parameter accepts a function that extracts a hashable key from each result. Only results with a new key are yielded, so you won’t process the same data twice when polling faster than updates arrive.

Drift correction

All polling utilities use drift-corrected scheduling to maintain the requested cadence even if individual polls are slow. Missed ticks are skipped rather than accumulated.

Next steps

Stream RHEED

Set up RHEED streaming from your instrument.

Client Reference

Full Client class documentation.