Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
Parse and execute a given workload (see `execute_workload()`)

        def manage_workload (workload, config) :
    Parse and execute a given workload (see `execute_workload()`)

    session      = troy.Session         (config)
    planner      = troy.Planner         (session)
    overlay_mgr  = troy.OverlayManager  (session)
    workload_mgr = troy.WorkloadManager (session)

    strategy = troy.AUTOMATIC
    if  'plugin_strategy' in session.cfg :
        strategy = session.cfg['plugin_strategy']

    if  strategy == troy.AUTOMATIC :
        strategy =  'basic_late_binding'

    # FIXME: we should also accept workload instances or json strings -- bext
    # put that flexibility into parse_workload
    parsed_workload = workload_mgr.parse_workload (workload)

    return troy.execute_workload (parsed_workload, planner, 
                                  overlay_mgr, workload_mgr,

src/t/r/troy-0.0.3/troy/__init__.py   troy(Download)
from overlay    import OverlayManager
from strategy   import manage_workload, execute_workload
# internal helper classes, exposed for plugin developers