Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Support using client in repl running tasks without rabbit

未关闭
#1,704 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
api, backend

调研方向

Start with src/blueapi/client/plan_cache.py, client.py, and event_bus.py, which appear in the traceback; trace how foreground task execution connects to the message bus. Compare the websocket option with the alternative acceptance criteria for background execution and clearer connection errors. Done means foreground tasks work through the chosen approach, or bus connection failures produce a helpful user facing error.

由索引模型根据 Issue 内容生成。

描述

c: client

If you try and use the client in a repl without stomp configured it errors with a stack trace showing it can't connect to the message bus. This is an unhelpful wall of text to be user facing.

>>> bc.plans.count(detectors=[bc.devices.det])
# 2026-10-20 10:00:18,596 INFO blueapi.client.plan_cache plan_cache.py:112 -- Building args for [detectors,num,delay,metadata], using () and {'detectors': [Device(det)]}

# 2026-10-20 10:00:18,605 INFO root messaging.py:366 -- Stomp client connecting...

# 2026-10-20 10:00:18,605 WARNING stomp.py transport.py:893 -- could not connect to host localhost, port 61613: [Errno 111] Connection refused

# 2026-10-20 10:00:18,807 WARNING stomp.py transport.py:893 -- could not connect to host localhost, port 61613: [Errno 111] Connection refused

# 2026-10-20 10:00:19,009 WARNING stomp.py transport.py:893 -- could not connect to host localhost, port 61613: [Errno 111] Connection refused

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/abi/projects/blueapi/src/blueapi/client/plan_cache.py", line 82, in __call__
    match self._client.run_task(req):
          ~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/home/abi/projects/blueapi/.venv/lib/python3.14/site-packages/observability_utils/tracing/decorators.py", line 151, in wrapper
    return func(*args, **kwargs)
  File "/home/abi/projects/blueapi/src/blueapi/client/client.py", line 400, in run_task
    with self._events:
         ^^^^^^^^^^^^
  File "/home/abi/projects/blueapi/src/blueapi/client/event_bus.py", line 27, in __enter__
    self.app.connect()
    ~~~~~~~~~~~~~~~~^^
  File "/home/abi/projects/blueapi/.venv/lib/python3.14/site-packages/bluesky_stomp/messaging.py", line 368, in connect
    self._connect_to_broker()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/abi/projects/blueapi/.venv/lib/python3.14/site-packages/bluesky_stomp/messaging.py", line 383, in _connect_to_broker
    self._conn.connect(wait=True)  # type: ignore
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/home/abi/projects/blueapi/.venv/lib/python3.14/site-packages/stomp/connect.py", line 151, in connect
    self.transport.start()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/home/abi/projects/blueapi/.venv/lib/python3.14/site-packages/stomp/transport.py", line 113, in start
    self.attempt_connection()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/abi/projects/blueapi/.venv/lib/python3.14/site-packages/stomp/transport.py", line 910, in attempt_connection
    raise exception.ConnectFailedException()
stomp.exception.ConnectFailedException

>>>

Acceptance Criteria

  • Preferably:
    -- The fg running option is changed to a websocket by default, removing the message bus from this loop
    -- If there are connection errors these are nicely wrapped for the user
  • Alternatively if if bus really wants to be kept for this:
    -- The client supports a background running option, like the --bg flag on the cli
    -- If you do try and run a plan in the fg without the bus you get a more helpful error
主要语言
Python
星标
13
派生
14
平均合并
4 天 14 小时
30 天内合并 PR
14

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DiamondLightSource/blueapi 的其他 Issue

查看 DiamondLightSource/blueapi 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。