Skip to content

Commit

Permalink
Added spinoff.actor.spawn as a shortcut to get_context().spawn()
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Allik committed Sep 26, 2013
1 parent 512260f commit c4217da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spinoff/actor/__init__.py
@@ -1,4 +1,5 @@
from ._actor import Actor
from .context import spawn
from .node import Node
# from .ref import Ref
from .uri import Uri
Expand All @@ -7,4 +8,4 @@
from .spin import spin


__all__ = [Actor, Node, Uri, Props, Unhandled, spin]
__all__ = [Actor, spawn, Node, Uri, Props, Unhandled, spin]
4 changes: 4 additions & 0 deletions spinoff/actor/context.py
Expand Up @@ -25,3 +25,7 @@ def __init__(self, cell):
self.sender = cell.actor.sender if cell.actor else None
self.node = cell.node
self.ref = cell.ref


def spawn(*args, **kwargs):
return get_context().spawn(*args, **kwargs)

0 comments on commit c4217da

Please sign in to comment.