Permalink
Browse files

service and process kwargs in endpoint creation mean the same thing

  • Loading branch information...
1 parent c0d5c5a commit ad6b4a54b60b6ae187d485c05c20c4a740c66b33 @daf daf committed Jan 10, 2013
Showing with 7 additions and 6 deletions.
  1. +0 −6 pyon/container/procs.py
  2. +6 −0 pyon/ion/endpoint.py
  3. +1 −0 pyon/net/endpoint.py
View
@@ -378,12 +378,10 @@ def _spawn_service_process(self, process_id, name, module, cls, config):
# Service RPC endpoint
rsvc1 = self._create_listening_endpoint(node=self.container.node,
from_name=listen_name,
- service=process_instance,
process=process_instance)
# Named local RPC endpoint
rsvc2 = self._create_listening_endpoint(node=self.container.node,
from_name=process_instance.id,
- service=process_instance,
process=process_instance)
# cleanup method to delete process queue
@@ -436,7 +434,6 @@ def _spawn_stream_process(self, process_id, name, module, cls, config):
rsvc = self._create_listening_endpoint(node=self.container.node,
from_name=process_instance.id,
- service=process_instance,
process=process_instance)
# cleanup method to delete process queue (@TODO: leaks a bit here - should use XOs)
@@ -490,14 +487,12 @@ def _spawn_agent_process(self, process_id, name, module, cls, config):
alistener = self._create_listening_endpoint(node=self.container.node,
from_name=resource_id,
- service=process_instance,
process=process_instance)
listeners.append(alistener)
rsvc = self._create_listening_endpoint(node=self.container.node,
from_name=process_instance.id,
- service=process_instance,
process=process_instance)
listeners.append(rsvc)
@@ -551,7 +546,6 @@ def _spawn_standalone_process(self, process_id, name, module, cls, config):
process_instance = self._create_process_instance(process_id, name, module, cls, config)
rsvc = self._create_listening_endpoint(node=self.container.node,
from_name=process_instance.id,
- service=process_instance,
process=process_instance)
# Add publishers if any...
View
@@ -268,6 +268,12 @@ def __init__(self, process=None, routing_call=None, **kwargs):
assert process
self._process = process
self._routing_call = routing_call
+
+ # don't make people set service and process when they're almost always the same
+ if not "service" in kwargs:
+ kwargs = kwargs.copy()
+ kwargs['service'] = process
+
RPCServer.__init__(self, **kwargs)
@property
View
@@ -1302,6 +1302,7 @@ class RPCServer(RequestResponseServer):
def __init__(self, service=None, **kwargs):
#log.debug("In RPCServer.__init__")
+ assert service
self._service = service
RequestResponseServer.__init__(self, **kwargs)

0 comments on commit ad6b4a5

Please sign in to comment.