コード例 #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
ファイル: agent.py プロジェクト: splice/gofer
 def __init__(self, threads):
     install(threads)
     pl = PluginLoader()
     plugins = pl.load(eager())
     agent = Agent(plugins)
     agent.start(False)
     while True:
         sleep(10)
         print 'Agent: sleeping...'
コード例 #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()
コード例 #5
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()
コード例 #6
0
ファイル: main.py プロジェクト: splice/gofer
def start(daemon=True):
    """
    Agent main.
    Add recurring, time-based actions here.
    All actions must be subclass of L{action.Action}.
    """
    lock = AgentLock()
    try:
        lock.acquire(0)
    except LockFailed, e:
        raise Exception('Agent already running')
    if daemon:
        daemonize(lock)
    try:
        pl = PluginLoader()
        plugins = pl.load(eager())
        agent = Agent(plugins)
        agent.start()
    finally:
        lock.release()

def eager():
    return int(nvl(cfg.loader.eager, 0))

def usage():
    """
    Show usage.
    """
    s = []
    s.append('\n%sd <options>' % NAME)