Skip to content

Instantly share code, notes, and snippets.

@gwbischof
Created January 25, 2023 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwbischof/b81acb957ac5688180ea3a530acffafb to your computer and use it in GitHub Desktop.
Save gwbischof/b81acb957ac5688180ea3a530acffafb to your computer and use it in GitHub Desktop.
import nslsii
from bluesky_kafka import Publisher
import uuid
from tiled.client import from_profile
c = from_profile("ucal")
config = nslsii._read_bluesky_kafka_config_file(config_file_path="/etc/bluesky/kafka.yml")
pub = Publisher(topic="ucal.bluesky.runengine.documents",
bootstrap_servers=",".join(config['bootstrap_servers']),
key=str(uuid.uuid4()),
producer_config=config['runengine_producer_config'],
flush_on_stop_doc=True)
run = c[-1]
for name, doc in run.documents():
pub(name, doc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment