def sender(): cur = actor.current() act.send('helllo') msg = cur.receive() output('reply comming') output(msg)
def test_supervisor(): def supervisor(): cur = actor.current() output(cur) output(cur.receive()) output(cur.receive()) def erroractor(): x = 10 / 0 def normalactor(): return 'Success' er = actor.start_child(erroractor) nm = actor.Actor(normalactor, actor.current()) supervisor()
def supervisor(): cur = actor.current() output(cur) output(cur.receive()) output(cur.receive())
def receiver(): cur = actor.current() cur.receive(replyto)
def receiver(): act = actor.current() act.receive(output)
def func(): print >> sys.stderr, actor.current()
def test_selfmsg(): cur = actor.current() cur.send('self messaging') output(cur.receive())
def receiver(): cur = actor.current() # noreceive が呼ばれるとキューの最後に回される cur.receive(lambda x:actor.noreceive()) output(cur.receive())