def __init__(self, app: web.Application): super().__init__(app) self._msgid = 0 self._timeout = app['config']['command_timeout'] self._active_messages: dict[int, asyncio.Future] = {} self._codec = codec.fget(app) self._conn = connection.fget(app)
async def format_trace(self, src): cdc = codec.fget(self.app) store = block_store.fget(self.app) dest = [] for src_v in src: action = src_v['action'] nid = src_v['id'] sid = store.left_key(nid, 'Unknown') typename = await cdc.decode(src_v['type']) if nid == 0: dest.append(action) else: dest.append(f'{action.ljust(20)} {typename.ljust(20)} [{sid},{nid}]') return dest
def __init__(self, app: web.Application): self._app = app self._name = app['config']['name'] self._store = block_store.fget(app) self._codec = codec.fget(app)
def cdc(app) -> Codec: return codec.fget(app)