Skip to content

Commit e2615f8

Browse files
committed
update
1 parent b8e1227 commit e2615f8

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

csi-async/async.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
#include <functional>
44
#include <cstdint>
55
#include <future>
6-
//#include <type_traits>
6+
#include <cassert>
77

88
#pragma once
99

1010
namespace csi {
1111
namespace async {
1212

1313
enum end_condition_t { FIRST_FAIL, FIRST_SUCCESS, ALL }; // could this be a user defined function instead??
14-
enum scheduling_t { PARALLEL, SEQUENTIAL }; // node async calls this parallell & waterfall
14+
enum scheduling_t { PARALLEL, SEQUENTIAL }; // node async calls this parallel & waterfall
1515

1616
template <typename result_type>
1717
class work
@@ -136,7 +136,17 @@ namespace csi {
136136
_end_condition(ec),
137137
_work(f) {}
138138

139-
void push_back(async_function f) { _work.push_back(f); }
139+
void push_back(async_function f) {
140+
_work.push_back(f);
141+
}
142+
143+
async_function get_function(size_t index) {
144+
return _work[index];
145+
}
146+
147+
result_type get_result(size_t index) {
148+
return (*_result)[index];
149+
}
140150

141151
result_type operator()() {
142152
std::promise<result_type> p;

0 commit comments

Comments
 (0)