Adam Lindsay avatar Adam Lindsay committed bb2fd17

Basic move to async/oneway communication seems to work.

Comments (0)

Files changed (3)

 
 service Store extends locator.Locator {
  string                 get     (1:string key)
- void                   put     (1:string key, 2:string value)
- StarterPackage         join    (1:locator.Location location)
- map<string, string>    add     (1:locator.Location location, 2:list<locator.Location> authorities)
+ oneway void            put     (1:string key, 2:string value)
+# StarterPackage         join    (1:locator.Location location)
+# map<string, string>    add     (1:locator.Location location, 2:list<locator.Location> authorities)
 }

gen-py/locator/Locator.py

      - authorities
     """
     self.send_remove(location, authorities)
-    self.recv_remove()
 
   def send_remove(self, location, authorities):
     self._oprot.writeMessageBegin('remove', TMessageType.CALL, self._seqid)
     args.write(self._oprot)
     self._oprot.writeMessageEnd()
     self._oprot.trans.flush()
-
-  def recv_remove(self, ):
-    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-    if mtype == TMessageType.EXCEPTION:
-      x = TApplicationException()
-      x.read(self._iprot)
-      self._iprot.readMessageEnd()
-      raise x
-    result = remove_result()
-    result.read(self._iprot)
-    self._iprot.readMessageEnd()
-    return
-
   def add(self, location, authorities):
     """
     Parameters:
      - authorities
     """
     self.send_add(location, authorities)
-    self.recv_add()
 
   def send_add(self, location, authorities):
     self._oprot.writeMessageBegin('add', TMessageType.CALL, self._seqid)
     args.write(self._oprot)
     self._oprot.writeMessageEnd()
     self._oprot.trans.flush()
-
-  def recv_add(self, ):
-    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-    if mtype == TMessageType.EXCEPTION:
-      x = TApplicationException()
-      x.read(self._iprot)
-      self._iprot.readMessageEnd()
-      raise x
-    result = add_result()
-    result.read(self._iprot)
-    self._iprot.readMessageEnd()
-    return
-
   def get_all(self, ):
     self.send_get_all()
     return self.recv_get_all()
 
   def ping(self, ):
     self.send_ping()
-    self.recv_ping()
 
   def send_ping(self, ):
     self._oprot.writeMessageBegin('ping', TMessageType.CALL, self._seqid)
     args.write(self._oprot)
     self._oprot.writeMessageEnd()
     self._oprot.trans.flush()
-
-  def recv_ping(self, ):
-    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-    if mtype == TMessageType.EXCEPTION:
-      x = TApplicationException()
-      x.read(self._iprot)
-      self._iprot.readMessageEnd()
-      raise x
-    result = ping_result()
-    result.read(self._iprot)
-    self._iprot.readMessageEnd()
-    return
-
   def debug(self, ):
     self.send_debug()
-    self.recv_debug()
 
   def send_debug(self, ):
     self._oprot.writeMessageBegin('debug', TMessageType.CALL, self._seqid)
     self._oprot.writeMessageEnd()
     self._oprot.trans.flush()
 
-  def recv_debug(self, ):
-    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-    if mtype == TMessageType.EXCEPTION:
-      x = TApplicationException()
-      x.read(self._iprot)
-      self._iprot.readMessageEnd()
-      raise x
-    result = debug_result()
-    result.read(self._iprot)
-    self._iprot.readMessageEnd()
-    return
-
-
 class Processor(Iface, TProcessor):
   def __init__(self, handler):
     self._handler = handler
     args = remove_args()
     args.read(iprot)
     iprot.readMessageEnd()
-    result = remove_result()
     self._handler.remove(args.location, args.authorities)
-    oprot.writeMessageBegin("remove", TMessageType.REPLY, seqid)
-    result.write(oprot)
-    oprot.writeMessageEnd()
-    oprot.trans.flush()
+    return
 
   def process_add(self, seqid, iprot, oprot):
     args = add_args()
     args.read(iprot)
     iprot.readMessageEnd()
-    result = add_result()
     self._handler.add(args.location, args.authorities)
-    oprot.writeMessageBegin("add", TMessageType.REPLY, seqid)
-    result.write(oprot)
-    oprot.writeMessageEnd()
-    oprot.trans.flush()
+    return
 
   def process_get_all(self, seqid, iprot, oprot):
     args = get_all_args()
     args = ping_args()
     args.read(iprot)
     iprot.readMessageEnd()
-    result = ping_result()
     self._handler.ping()
-    oprot.writeMessageBegin("ping", TMessageType.REPLY, seqid)
-    result.write(oprot)
-    oprot.writeMessageEnd()
-    oprot.trans.flush()
+    return
 
   def process_debug(self, seqid, iprot, oprot):
     args = debug_args()
     args.read(iprot)
     iprot.readMessageEnd()
-    result = debug_result()
     self._handler.debug()
-    oprot.writeMessageBegin("debug", TMessageType.REPLY, seqid)
-    result.write(oprot)
-    oprot.writeMessageEnd()
-    oprot.trans.flush()
+    return
 
 
 # HELPER FUNCTIONS AND STRUCTURES
   def __ne__(self, other):
     return not (self == other)
 
-class remove_result(object):
-
-  thrift_spec = (
-  )
-
-  def read(self, iprot):
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-      return
-    iprot.readStructBegin()
-    while True:
-      (fname, ftype, fid) = iprot.readFieldBegin()
-      if ftype == TType.STOP:
-        break
-      else:
-        iprot.skip(ftype)
-      iprot.readFieldEnd()
-    iprot.readStructEnd()
-
-  def write(self, oprot):
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-      return
-    oprot.writeStructBegin('remove_result')
-    oprot.writeFieldStop()
-    oprot.writeStructEnd()
-
-  def __repr__(self):
-    L = ['%s=%r' % (key, value)
-      for key, value in self.__dict__.iteritems()]
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
-  def __eq__(self, other):
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
-  def __ne__(self, other):
-    return not (self == other)
-
 class add_args(object):
   """
   Attributes:
   def __ne__(self, other):
     return not (self == other)
 
-class add_result(object):
-
-  thrift_spec = (
-  )
-
-  def read(self, iprot):
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-      return
-    iprot.readStructBegin()
-    while True:
-      (fname, ftype, fid) = iprot.readFieldBegin()
-      if ftype == TType.STOP:
-        break
-      else:
-        iprot.skip(ftype)
-      iprot.readFieldEnd()
-    iprot.readStructEnd()
-
-  def write(self, oprot):
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-      return
-    oprot.writeStructBegin('add_result')
-    oprot.writeFieldStop()
-    oprot.writeStructEnd()
-
-  def __repr__(self):
-    L = ['%s=%r' % (key, value)
-      for key, value in self.__dict__.iteritems()]
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
-  def __eq__(self, other):
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
-  def __ne__(self, other):
-    return not (self == other)
-
 class get_all_args(object):
 
   thrift_spec = (
   def __ne__(self, other):
     return not (self == other)
 
-class ping_result(object):
-
-  thrift_spec = (
-  )
-
-  def read(self, iprot):
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-      return
-    iprot.readStructBegin()
-    while True:
-      (fname, ftype, fid) = iprot.readFieldBegin()
-      if ftype == TType.STOP:
-        break
-      else:
-        iprot.skip(ftype)
-      iprot.readFieldEnd()
-    iprot.readStructEnd()
-
-  def write(self, oprot):
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-      return
-    oprot.writeStructBegin('ping_result')
-    oprot.writeFieldStop()
-    oprot.writeStructEnd()
-
-  def __repr__(self):
-    L = ['%s=%r' % (key, value)
-      for key, value in self.__dict__.iteritems()]
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
-  def __eq__(self, other):
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
-  def __ne__(self, other):
-    return not (self == other)
-
 class debug_args(object):
 
   thrift_spec = (
   def __ne__(self, other):
     return not (self == other)
 
-class debug_result(object):
 
-  thrift_spec = (
-  )
-
-  def read(self, iprot):
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-      return
-    iprot.readStructBegin()
-    while True:
-      (fname, ftype, fid) = iprot.readFieldBegin()
-      if ftype == TType.STOP:
-        break
-      else:
-        iprot.skip(ftype)
-      iprot.readFieldEnd()
-    iprot.readStructEnd()
-
-  def write(self, oprot):
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-      return
-    oprot.writeStructBegin('debug_result')
-    oprot.writeFieldStop()
-    oprot.writeStructEnd()
-
-  def __repr__(self):
-    L = ['%s=%r' % (key, value)
-      for key, value in self.__dict__.iteritems()]
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
-  def __eq__(self, other):
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
-  def __ne__(self, other):
-    return not (self == other)
-
-
 
 service Locator {
  list<Location> join    (1:Location location)
- void           remove  (1:Location location, 2:list<Location> authorities)
- void           add     (1:Location location, 2:list<Location> authorities)
+ oneway void    remove  (1:Location location, 2:list<Location> authorities)
+ oneway void    add     (1:Location location, 2:list<Location> authorities)
  list<Location> get_all ()
  Location       get_node(1:string key)
  void           ping    ()
- void           debug   ()
+ oneway void    debug   ()
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.