Пример #1
0
def get_all_p():
    processor_manager = app.config['PROCESSOR_MANAGER']
    processors = list(
        map(lambda processor_state: processor_state['processor'],
            processor_manager))
    response = Processor.to_json_responses(*processors, timestamp=time.time())
    return jsonify(response)
Пример #2
0
def stop_all_p():
    processor_manager = app.config['PROCESSOR_MANAGER']
    processors = Processor.from_json_request(request.json, many=True)
    names = list(map(lambda psor: psor.name, processors))
    results = []
    for name in names:
        processor = _stop_p(name, processor_manager)
        results.append(processor)
    response = Processor.to_json_responses(*results, time.time())
    return jsonify(response)
Пример #3
0
def run_all_p():
    process_manager = app.config['PROCESS_MANAGER']
    processor_manager = app.config['PROCESSOR_MANAGER']
    body = request.json

    processors = Processor.from_json_request(body, many=True)
    results = []
    for processor in processors:
        name = processor.name
        processor = _run_p(name, processor, processor_manager, process_manager)
        results.append(processor)
    response = Processor.to_json_responses(*results, time.time())
    return jsonify(response)