Beispiel #1
0
def worker_start(domain, region):
    worker = SWFWorker(domain, region)

    @worker.role('echo')
    def echo(msg):
        print(msg)

    worker.start(domain=domain, region=region)
Beispiel #2
0
def worker_start(domain, region):
    worker = SWFWorker(domain, region)

    @worker.role('echo')
    def echo(msg):
        print(msg)

    worker.start(domain=domain, region=region)
Beispiel #3
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


# local modules
import mass
from mass import Job, Task, Action
from mass.scheduler.swf import SWFWorker

with Job("Echo Job") as a_job:
    with Task("Task #1"):
        Action("[Task #1] Let's initiate something here first.")
    with Task("Task #2", parallel=True):
        with Task("Task #2.1"):
            Action("[Task #2.1] Do something here. $(sleep)")
            Action("[Task #2.1] Another action here at $(date).")
        with Task("Task #2.2"):
            Action("[Task #2.2] Do something here. $(sleep)")
            Action("[Task #2.2] Another action here at $(date).")
    with Task("Task #3"):
        Action("All is done!")

mass.start(a_job)
worker = SWFWorker.start()
Beispiel #4
0
def worker_start():
    worker = SWFWorker()
    worker.start()