How to use the simgrid.Actor.self 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-daemon / actor-daemon.py View on Github external
def my_daemon():
    """The daemon, displaying a message every 3 seconds until all other processes stop"""
    Actor.self().daemonize()

    while True:
        this_actor.info("Hello from the infinite loop")
        this_actor.sleep_for(3.0)

    this_actor.info(
        "I will never reach that point: daemons are killed when regular processes are done")