Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion osbrain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ def mkdir(directory, **kwargs):

import Pyro4
Pyro4.config.SERIALIZERS_ACCEPTED.add('pickle')
Pyro4.config.SERIALIZERS_ACCEPTED.add('cloudpickle')
Pyro4.config.SERIALIZERS_ACCEPTED.add('dill')
Pyro4.config.SERIALIZER = 'dill'
Pyro4.config.SERIALIZER = 'cloudpickle'
Pyro4.config.THREADPOOL_SIZE = 16
Pyro4.config.SERVERTYPE = 'thread'
Pyro4.config.REQUIRE_EXPOSE = False
Expand Down
8 changes: 4 additions & 4 deletions osbrain/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def _handle_loopback(self, message):
"""
Handle incoming messages in the loopback socket.
"""
header, data = dill.loads(message)
header, data = cloudpickle.loads(message)
if header == 'EXECUTE_METHOD':
method, args, kwargs = data
try:
Expand All @@ -277,7 +277,7 @@ def _handle_loopback_safe(self, data):
"""
Handle incoming messages in the _loopback_safe socket.
"""
method, args, kwargs = dill.loads(data)
method, args, kwargs = cloudpickle.loads(data)
try:
response = getattr(self, method)(*args, **kwargs)
except Exception as error:
Expand Down Expand Up @@ -306,7 +306,7 @@ def _loopback(self, header, data=None):
"""
if not self.running:
raise NotImplementedError()
data = dill.dumps((header, data))
data = cloudpickle.dumps((header, data))
return self._loopback_reqrep('inproc://loopback', data)

def safe_call(self, method, *args, **kwargs):
Expand All @@ -327,7 +327,7 @@ def safe_call(self, method, *args, **kwargs):
if not self.running:
raise RuntimeError(
'Agent must be running to safely execute methods!')
data = dill.dumps((method, args, kwargs))
data = cloudpickle.dumps((method, args, kwargs))
return self._loopback_reqrep('inproc://_loopback_safe', data)

def each(self, period, method, *args, alias=None, **kwargs):
Expand Down