コード例 #1
0
ファイル: agent.py プロジェクト: pombreda/gofer
 def __init__(self, url, uuid, threads, auth, exchange):
     setup_logging()
     install(url, uuid, threads, auth, exchange)
     PluginLoader.load_all()
     agent = Agent()
     agent.start(False)
     while True:
         sleep(10)
         print 'Agent: sleeping...'
コード例 #2
0
ファイル: agent.py プロジェクト: swipswaps/gofer
 def __init__(self, url, queue, threads, auth, exchange):
     setup_logging()
     install(url, queue, threads, auth, exchange)
     PluginLoader.load_all()
     agent = Agent()
     agent.start(False)
     while True:
         sleep(10)
         print('Agent: sleeping...')
コード例 #3
0
ファイル: main.py プロジェクト: pombreda/gofer
def start(daemon=True):
    """
    Agent main.
    Add recurring, time-based actions here.
    All actions must be subclass of action.Action.
    """
    lock = AgentLock()
    try:
        lock.acquire(False)
    except LockFailed:
        raise Exception('Agent already running')
    if daemon:
        start_daemon(lock)
    try:
        PluginLoader.load_all()
        agent = Agent()
        agent.start()
    finally:
        lock.release()
コード例 #4
0
ファイル: main.py プロジェクト: pombreda/gofer
def start(daemon=True):
    """
    Agent main.
    Add recurring, time-based actions here.
    All actions must be subclass of action.Action.
    """
    lock = AgentLock()
    try:
        lock.acquire(False)
    except LockFailed:
        raise Exception('Agent already running')
    if daemon:
        start_daemon(lock)
    try:
        PluginLoader.load_all()
        agent = Agent()
        agent.start()
    finally:
        lock.release()