示例#1
0
        def __init__(
            self,
            flux_handle,
            topic,
            payload=None,
            nodeid=flux.constants.FLUX_NODEID_ANY,
            flags=0,
        ):
            # hold a reference for destructor ordering
            self._handle = flux_handle
            dest = raw.flux_future_destroy
            super(RPC.InnerWrapper, self).__init__(
                ffi,
                lib,
                handle=None,
                match=ffi.typeof(lib.flux_rpc).result,
                prefixes=["flux_rpc_"],
                destructor=dest,
            )
            if isinstance(flux_handle, Wrapper):
                flux_handle = flux_handle.handle

            topic = encode_topic(topic)
            payload = encode_payload(payload)

            self.handle = raw.flux_rpc(flux_handle, topic, payload, nodeid,
                                       flags)
示例#2
0
文件: rpc.py 项目: grondo/flux-core
        def __init__(
            self,
            flux_handle,
            topic,
            payload=None,
            nodeid=flux.constants.FLUX_NODEID_ANY,
            flags=0,
        ):
            # hold a reference for destructor ordering
            self._handle = flux_handle
            dest = raw.flux_future_destroy
            super(RPC.InnerWrapper, self).__init__(
                ffi,
                lib,
                handle=None,
                match=ffi.typeof(lib.flux_rpc).result,
                prefixes=["flux_rpc_"],
                destructor=dest,
            )
            if isinstance(flux_handle, Wrapper):
                flux_handle = flux_handle.handle

            topic = encode_topic(topic)
            payload = encode_payload(payload)

            self.handle = raw.flux_rpc(flux_handle, topic, payload, nodeid, flags)
示例#3
0
    def __init__(
        self,
        flux_handle,
        topic,
        payload=None,
        nodeid=flux.constants.FLUX_NODEID_ANY,
        flags=0,
    ):
        if isinstance(flux_handle, Wrapper):
            # keep the flux_handle alive for the lifetime of the RPC
            self.flux_handle = flux_handle
            flux_handle = flux_handle.handle

        topic = encode_topic(topic)
        payload = encode_payload(payload)

        future_handle = raw.flux_rpc(flux_handle, topic, payload, nodeid, flags)
        super(RPC, self).__init__(future_handle, prefixes=["flux_rpc_", "flux_future_"])
示例#4
0
    def __init__(
        self,
        flux_handle,
        topic,
        payload=None,
        nodeid=flux.constants.FLUX_NODEID_ANY,
        flags=0,
    ):
        if isinstance(flux_handle, Wrapper):
            # keep the flux_handle alive for the lifetime of the RPC
            self.flux_handle = flux_handle
            flux_handle = flux_handle.handle

        topic = encode_topic(topic)
        payload = encode_payload(payload)

        future_handle = raw.flux_rpc(flux_handle, topic, payload, nodeid,
                                     flags)
        super(RPC, self).__init__(future_handle,
                                  prefixes=["flux_rpc_", "flux_future_"])
示例#5
0
 def test_set_pimpl_handle(self):
     f = flux.Flux("loop://")
     r = f.rpc("topic")
     r.handle = raw.flux_rpc(
         f.handle, "other topic", ffi.NULL, flux.constants.FLUX_NODEID_ANY, 0
     )