示例#1
0
 def recv(self, type_mask=raw.FLUX_MSGTYPE_ANY, match_tag=raw.FLUX_MATCHTAG_NONE, topic_glob=None, flags=0):
     """ Receive a message, returns a flux.Message containing the result or None """
     match = ffi.new(
         "struct flux_match *",
         {
             "typemask": type_mask,
             "matchtag": match_tag,
             "topic_glob": topic_glob if topic_glob is not None else ffi.NULL,
         },
     )
     handle = self.flux_recv(match[0], flags)
     if handle is not None:
         return Message(handle=handle)
     else:  # pragma: no cover
         return None
示例#2
0
 def recv(self,
          type_mask=flux.FLUX_MSGTYPE_ANY,
          match_tag=flux.FLUX_MATCHTAG_NONE,
          topic_glob=None,
          bsize=0,
          flags=0):
     """ Receive a message, returns a flux.Message containing the result or None """
     match = ffi.new('struct flux_match *', {
         'typemask': type_mask,
         'matchtag': match_tag,
         'topic_glob': topic_glob if topic_glob is not None else ffi.NULL,
         'bsize': bsize,
     })
     handle = self.flux_recv(match[0], flags)
     if handle is not None:
         return Message(handle=handle)
     else:  # pragma: no cover
         return None
示例#3
0
 def recv(self,
          type_mask=raw.FLUX_MSGTYPE_ANY,
          match_tag=raw.FLUX_MATCHTAG_NONE,
          topic_glob=None,
          flags=0):
     """
     Receive a message, returns a flux.Message containing the result or None
     """
     match = ffi.new(
         'struct flux_match *', {
             'typemask': type_mask,
             'matchtag': match_tag,
             'topic_glob':
             topic_glob if topic_glob is not None else ffi.NULL,
         })
     handle = self.flux_recv(match[0], flags)
     if handle is not None:
         return Message(handle=handle)
     else:  # pragma: no cover
         return None
示例#4
0
 def get_rank(self):
     rank = ffi.new("uint32_t [1]")
     self.flux_get_rank(rank)
     return rank[0]
示例#5
0
 def get_str(self):
     c_nodeid = ffi.new('uint32_t [1]')
     j_str = ffi.new('char *[1]')
     self.pimpl.get(c_nodeid, j_str)
     return ffi.string(j_str[0])
示例#6
0
 def get_rank(self):
     rank = ffi.new('uint32_t [1]')
     self.flux_get_rank(rank)
     return rank[0]
示例#7
0
文件: rpc.py 项目: dongahn/flux-core
 def get_str(self):
   j_str = ffi.new('char *[1]')
   self.pimpl.get(ffi.NULL, j_str)
   return ffi.string(j_str[0])
示例#8
0
文件: rpc.py 项目: cigolabs/flux-core
 def get_str(self):
   c_nodeid = ffi.new('uint32_t [1]')
   j_str = ffi.new('char *[1]')
   self.pimpl.get(c_nodeid, j_str)
   return ffi.string(j_str[0])