workflow.h 1.1 KB
Newer Older
W
wangguibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#ifndef BAIDU_PADDLE_SERVING_PREDICTOR_WORKFLOW_H
#define BAIDU_PADDLE_SERVING_PREDICTOR_WORKFLOW_H

#include "common/inner_common.h"
#include "framework/dag.h"
#include "framework/dag_view.h"

namespace baidu {
namespace paddle_serving {
namespace predictor {

template<typename T>
class Manager;

class Workflow {
public:
    Workflow() {}

    static const char* tag() {
W
wangguibao 已提交
20
        return "workflow";
W
wangguibao 已提交
21 22 23 24 25
    }

    // Each workflow object corresponds to an independent
    // configure file, so you can share the object between
    // different apps.
W
wangguibao 已提交
26
    int init(const configure::Workflow& conf);
W
wangguibao 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
        
    DagView* fetch_dag_view(const std::string& service_name);

    int deinit() { return 0; }
        
    void return_dag_view(DagView* view);

    int reload();
    
    const std::string& name() {
        return _name;
    }
    
    const std::string& full_name() {
        return _name;
    }

    void regist_metric(const std::string& service_name);

private:
    Dag _dag;
    std::string _type;
    std::string _name;
};

} // predictor
} // paddle_serving
} // baidu

#endif