Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 708 Bytes

Embedding.md

File metadata and controls

18 lines (15 loc) · 708 Bytes

Embedding PipeFabric

Implementing a program just for a single query isn't very useful - the main purpose of the PipeFabric framework is to embed stream processing into other applications. That means that instead of writing results to a file or to the console as in the example above, result tuples are passed to other components of your application. This is achieved very easily by using the notify operator which invokes your code (e.g. a lambda function) for each incoming tuple. Thus, the example above can be modified:

auto s = t->newStreamFromREST(8099, "^/publish$", RESTSource::POST_METHOD)
  ...
  .notify([&](auto tp, bool outdated) {
    std::cout << tp << std::endl;
  });