コード例 #1
0
ファイル: handle.py プロジェクト: vchuravy/flux-core
    def __init__(self, url=ffi.NULL, flags=0, handle=None):
        super(Flux, self).__init__(
            ffi,
            lib,
            handle=handle,
            match=ffi.typeof(lib.flux_open).result,
            filter_match=False,
            prefixes=["flux_", "FLUX_"],
            destructor=raw.flux_close,
        )

        # Ensure reactor_depth is initialized for this thread
        if "reactor_depth" not in self.tls.__dict__:
            self.tls.reactor_depth = 0
            self.tls.exception = None

        if handle is None:
            try:
                self.handle = raw.flux_open(url, flags)
            except EnvironmentError as err:
                raise EnvironmentError(
                    err.errno, "Unable to connect to Flux: {}".format(err.strerror)
                )

        self.aux_txn = None
コード例 #2
0
ファイル: handle.py プロジェクト: SteVwonder/flux-core
    def __init__(self, url=ffi.NULL, flags=0, handle=None):
        super(self.__class__, self).__init__(
            ffi,
            lib,
            handle=handle,
            match=ffi.typeof(lib.flux_open).result,
            filter_match=False,
            prefixes=["flux_", "FLUX_"],
            destructor=raw.flux_close,
        )

        if handle is None:
            self.handle = raw.flux_open(url, flags)
コード例 #3
0
    def __init__(self, url=ffi.NULL, flags=0, handle=None):
        super(Flux, self).__init__(
            ffi,
            lib,
            handle=handle,
            match=ffi.typeof(lib.flux_open).result,
            filter_match=False,
            prefixes=["flux_", "FLUX_"],
            destructor=raw.flux_close,
        )

        if handle is None:
            self.handle = raw.flux_open(url, flags)

        self.aux_txn = None
コード例 #4
0
ファイル: handle.py プロジェクト: nikhil-jain/flux-core
    def __init__(self, url=ffi.NULL, flags=0, handle=None):
        super(self.__class__, self).__init__(
            ffi,
            lib,
            handle=handle,
            match=ffi.typeof(lib.flux_open).result,
            filter_match=False,
            prefixes=[
                'flux_',
                'FLUX_',
            ],
            destructor=raw.flux_close,
        )

        if handle is None:
            self.handle = raw.flux_open(url, flags)
コード例 #5
0
ファイル: handle.py プロジェクト: surajpkn/flux-core
    def __init__(self, url=ffi.NULL, flags=0, handle=None):
        self.external = True
        self.handle = None

        if handle is None:
            handle = raw.flux_open(url, flags)
            self.external = False

        super(self.__class__, self).__init__(
            ffi, lib,
            handle=handle,
            match=ffi.typeof(lib.flux_open).result,
            filter_match=False,
            prefixes=[
                'flux_',
                'FLUX_',
            ], )
コード例 #6
0
ファイル: handle.py プロジェクト: SteVwonder/flux-core
    def __init__(self, url=ffi.NULL, flags=0, handle=None):
        super(Flux, self).__init__(
            ffi,
            lib,
            handle=handle,
            match=ffi.typeof(lib.flux_open).result,
            filter_match=False,
            prefixes=["flux_", "FLUX_"],
            destructor=raw.flux_close,
        )

        if handle is None:
            try:
                self.handle = raw.flux_open(url, flags)
            except EnvironmentError as err:
                raise EnvironmentError(
                    err.errno,
                    "Unable to connect to Flux: {}".format(err.strerror))

        self.aux_txn = None