joque
task orchestration library
print_exec_visitor.hpp
Go to the documentation of this file.
1 #pragma once
23 
24 #include "dag.hpp"
25 #include "exec_visitor.hpp"
26 #include "records.hpp"
27 
28 #include <iostream>
29 #include <span>
30 #include <string_view>
31 
32 namespace joque
33 {
34 
37 {
38 public:
39  print_exec_visitor( bool verbose = false );
40 
41  void after_node_enque( const dag_node& n ) override;
42 
43  void on_detected_cycle( std::span< const dag_node* > c ) override;
44 
45  void after_job_is_inval( const dag_node& n, std::string_view log ) override;
46 
47  void after_dep_inval( const dag_node& n, const dag_node& invalidator ) override;
48 
49  void before_run( const exec_record& erec, const dag_node& n ) override;
50 
51  void on_run_log( const dag_node& n, std::string_view log ) override;
52 
53  void
54  after_run( const exec_record& erec, const run_record* rec, const dag_node& n ) override;
55 
56  void on_tick( const exec_record& erec ) override;
57 
58  void after_execution( const exec_record& ) override;
59 
61 
62 private:
63  struct impl;
64 
65  std::unique_ptr< impl > impl_;
66 };
67 
70 
71 } // namespace joque
Definition: dag.hpp:97
Execution visitor interface, used by execution.
Definition: exec_visitor.hpp:33
Default visitor for execution. Prints information on stdout or stderr.
Definition: print_exec_visitor.hpp:37
void after_execution(const exec_record &) override
Run after execution finished.
void on_tick(const exec_record &erec) override
print_exec_visitor(bool verbose=false)
void after_node_enque(const dag_node &n) override
Run after node is enqued.
void before_run(const exec_record &erec, const dag_node &n) override
Executed once execution starts for the node.
void on_detected_cycle(std::span< const dag_node * > c) override
Ran in case cycle is detected.
void after_run(const exec_record &erec, const run_record *rec, const dag_node &n) override
Executed after execution of node.
void on_run_log(const dag_node &n, std::string_view log) override
Run after job finished execution.
void after_dep_inval(const dag_node &n, const dag_node &invalidator) override
Run after node became invalidated because of other node.
void after_job_is_inval(const dag_node &n, std::string_view log) override
Run after check whenever job was invalidated.
MIT License.
Definition: dag.hpp:27
print_exec_visitor PRINT_VISITOR
Global instance of print visitor used as default argument for exec
Definition: print_exec_visitor.hpp:69
Record of execution of entire task set.
Definition: records.hpp:90
Record storing information about a run of one task, produced during single execution once for each ta...
Definition: records.hpp:55