1 #ifndef SRC_NODE_BOB_INL_H_
2 #define SRC_NODE_BOB_INL_H_
3
4 #include "node_bob.h"
5
6 #include <functional>
7
8 namespace node {
9 namespace bob {
10
11 template <typename T>
Pull(Next<T> next,int options,T * data,size_t count,size_t max_count_hint)12 int SourceImpl<T>::Pull(
13 Next<T> next,
14 int options,
15 T* data,
16 size_t count,
17 size_t max_count_hint) {
18
19 int status;
20 if (eos_) {
21 status = bob::Status::STATUS_EOS;
22 std::move(next)(status, nullptr, 0, [](size_t len) {});
23 return status;
24 }
25
26 status = DoPull(std::move(next), options, data, count, max_count_hint);
27
28 if (status == bob::Status::STATUS_END)
29 eos_ = true;
30
31 return status;
32 }
33
34 } // namespace bob
35 } // namespace node
36
37 #endif // SRC_NODE_BOB_INL_H_
38