How to use the simgrid.this_actor.on_exit function in simgrid

To help you get started, we’ve selected a few simgrid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github simgrid / simgrid / examples / python / actor-lifetime / actor-lifetime.py View on Github external
def __init__(self, *args):
        # sys.exit(1); simgrid.info("Exiting now (done sleeping or got killed)."))
        this_actor.on_exit(lambda: print("BAAA"))
github simgrid / simgrid / examples / python / actor-kill / actor-kill.py View on Github external
def victim_a_fun():
    this_actor.on_exit(lambda: this_actor.info("I have been killed!"))
    this_actor.info("Hello!")
    this_actor.info("Suspending myself")
    this_actor.suspend()                        # - Start by suspending itself
    # - Then is resumed and start to execute a task
    this_actor.info("OK, OK. Let's work")
    this_actor.execute(1e9)
    # - But will never reach the end of it
    this_actor.info("Bye!")