How to use the callosum.rpc.RPCUserError function in callosum

To help you get started, we’ve selected a few callosum examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lablup / backend.ai-manager / src / ai / backend / manager / registry.py View on Github external
peer = PeerInvoker(
            connect=ZeroMQAddress(addr),
            transport=ZeroMQRPCTransport,
            serializer=msgpack.packb,
            deserializer=msgpack.unpackb,
        )
        await peer.__aenter__()
        agent_peers[addr] = peer
    try:
        with _timeout(timeout):
            okey_token = peer.call.order_key.set('')
            try:
                yield peer
            finally:
                peer.call.order_key.reset(okey_token)
    except RPCUserError as orig_exc:
        raise AgentError(orig_exc.name, orig_exc.args)
    except Exception:
        raise
github lablup / backend.ai-agent / src / ai / backend / agent / k8s / agent.py View on Github external
peer = agent_peers.get(addr, None)
    if peer is None:
        log.debug('Estabilshing connection to tcp://{}:16001', addr)
        peer = PeerInvoker(
            connect=ZeroMQAddress(f'tcp://{addr}:16001'),
            transport=ZeroMQRPCTransport,
            serializer=msgpack.packb,
            deserializer=msgpack.unpackb,
        )
        await peer.__aenter__()
        agent_peers[addr] = peer
    try:
        with _timeout(timeout):
            peer.call.order_key.set(order_key)
            yield peer
    except RPCUserError as orig_exc:
        raise AgentError(orig_exc.name, orig_exc.args)
    except Exception:
        raise

callosum

Callosum RPC Library

MIT
Latest version published 8 months ago

Package Health Score

56 / 100
Full package analysis

Similar packages