Skip to content

createDataReleaseWatcher ​

Import from: @xbbg/xnews

createDataReleaseWatcher<Row>(source, options?): AsyncGenerator<DataProviderResult<Row>>

Defined in: src/data.ts (declaration: data.d.ts:33)

Polls a source and yields a result whenever a new release appears. For sources that publish one release per date, "new" means a strictly later asOf (ISO date strings compare lexically). For sequenced sources — releases carrying a monotonic sequence — "new" means a strictly greater sequence, the last yielded sequence is passed as afterSequence so the source serves a backlog in order, and the backlog is drained without sleeping between polls. Failed polls are yielded once per distinct failure — consecutive identical failures are suppressed until a poll succeeds — and empty polls or already-seen releases yield nothing. Each poll passes the last known asOf as ifNewerThan so heavy sources can skip re-downloading an unchanged upstream. Like the news watchers, the generator runs until signal aborts.

Type Parameters ​

Row ​

Row

Parameters ​

source ​

DataSource<Row>

options? ​

DataReleaseWatcherOptions

Returns ​

AsyncGenerator<DataProviderResult<Row>>

Last updated:

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.