diff --git a/busrtworker/app.py b/busrtworker/app.py index a5290fc..dcaf7c9 100644 --- a/busrtworker/app.py +++ b/busrtworker/app.py @@ -6,7 +6,9 @@ import signal from collections import UserList from enum import Enum, auto from typing import Callable, Coroutine, Dict, List, Optional + from loguru import logger + from busrtworker.boostrap import RpcBoot from busrtworker.busrt import OP_PUBLISH, Client, Frame, Rpc, serialize from busrtworker.kink import di @@ -35,6 +37,11 @@ class ConnectionInfo: bus: Client = self.bus await bus.send(topic, Frame(serialize(data) if decode else data, tp=OP_PUBLISH)) + def client_name(self): + if not self.bus: + raise ValueError('must be init busrt client could call') + return self.bus.name + class Router: table: dict = {} diff --git a/pyproject.toml b/pyproject.toml index 0687427..3edb9a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "busrt-worker" -version = "0.1.2" +version = "0.1.3" description = "busrt-worker is a Python-based async busrt message handle framework" authors = ["JimZhang "] repository = "https://git.loom.run/Coder/amqp-worker"