~ubuntu-branches/ubuntu/precise/protobuf/precise

« back to all changes in this revision

Viewing changes to python/google/protobuf/service.py

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2009-11-16 10:41:33 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091116104133-ykhy3deg5l4975tw
Tags: 2.1.0-1ubuntu1
* Merge from Debian testing.
* Remaining Ubuntu changes:
  - Disable the death tests on IA64, now as a quilt patch.
  - Don't use python2.4, also as a quilt patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
"""Declares the RPC service interfaces.
32
32
 
33
33
This module declares the abstract interfaces underlying proto2 RPC
34
 
services.  These are intented to be independent of any particular RPC
 
34
services.  These are intended to be independent of any particular RPC
35
35
implementation, so that proto2 services can be used on top of a variety
36
36
of implementations.
37
37
"""
39
39
__author__ = 'petar@google.com (Petar Petrov)'
40
40
 
41
41
 
 
42
class RpcException(Exception):
 
43
  """Exception raised on failed blocking RPC method call."""
 
44
  pass
 
45
 
 
46
 
42
47
class Service(object):
43
48
 
44
49
  """Abstract base interface for protocol-buffer-based RPC services.
49
54
  its exact type at compile time (analogous to the Message interface).
50
55
  """
51
56
 
52
 
  def GetDescriptor(self):
 
57
  def GetDescriptor():
53
58
    """Retrieves this service's descriptor."""
54
59
    raise NotImplementedError
55
60
 
57
62
                 request, done):
58
63
    """Calls a method of the service specified by method_descriptor.
59
64
 
 
65
    If "done" is None then the call is blocking and the response
 
66
    message will be returned directly.  Otherwise the call is asynchronous
 
67
    and "done" will later be called with the response value.
 
68
 
 
69
    In the blocking case, RpcException will be raised on error.
 
70
    Asynchronous calls must check status via the Failed method of the
 
71
    RpcController.
 
72
 
60
73
    Preconditions:
61
74
    * method_descriptor.service == GetDescriptor
62
75
    * request is of the exact same classes as returned by