Subscribe to run updates using async iterators
break
the loop when you want to stop listening for updates.
Authentication: This function supports both server-side and client-side authentication. For server-side authentication, use your API key. For client-side authentication, you must generate a public access token with read access to the specific batch. See our authentication guide for details.
Response: The AsyncIterator yields the run object.
subscribeToRunsWithTag
, you can pass a union of task types:
metadata.set()
, metadata.append()
, or other metadata methods, all subscribers to that run will automatically receive the updated run object containing the new metadata.
This makes metadata perfect for: