Skip to content

Open feeds for your workers' topics (WebSocketFeed)

The topics are the dependency: resolve the topics the workers listen to into feeds, apply the plan, delete the feeds when done. In C# (market-data-devkit):

// The input topics of the workers this run deploys (or read them from the catalog).
var topics = pairs.Select(p => MarketNames.OrderBookUpdateTopic("binance", p)).ToList();
// Group by venue preset and world, split by the presets' limits, name each feed deterministically.
var plan = FeedResolver.Resolve(topics, new FeedResolverOptions { Owner = runGroup });
plan.ThrowIfIncomplete();                        // unknown topics or over a limit: never silent
var feeds = new FeedOrchestrator(workManager, feedPackageUrl);
await feeds.ApplyAsync(plan);                    // create, or serve the set, by feed name
await feeds.DeleteAsync(plan);                   // at the end: delete the feeds of this plan

examples/dotnet/platform.cs wraps both (ServeTopicsAsync), and Python has the same (virtufin.marketdata_devkit.feeds.resolve, apply, delete). ApplyAsync is idempotent and order-independent: run it before or after the workers start, and again whenever their topics change. A feed created with releasewhenidleminutes that released itself is created again by the next apply.

The feed's config and commands: WebSocketFeed.