File indexing completed on 2025-02-09 06:39:41

0001 /*
0002     SPDX-FileCopyrightText: 2019 Ivan Čukić <ivan.cukic(at)kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include <iostream>
0008 
0009 #include <voy/operations/merge.h>
0010 #include <voy/operations/slice.h>
0011 #include <voy/operations/transform.h>
0012 #include <voy/operations/filter.h>
0013 #include <voy/operations/identity.h>
0014 
0015 #include <voy/basic/delayed.h>
0016 #include <voy/basic/values.h>
0017 #include <voy/basic/sink.h>
0018 
0019 #include <voy/wrappers/process.h>
0020 #include <voy/wrappers/tcp_service.h>
0021 #include <voy/wrappers/zmq_service.h>
0022 
0023 #include <voy/engine/event_loop.h>
0024 
0025 #include <voy/dsl.h>
0026 
0027 #include <boost/thread/thread.hpp>
0028 
0029 int main(int argc, char *argv[])
0030 {
0031     using voy::dsl::operator|;
0032     using namespace std::literals::string_literals;
0033     using namespace std::literals::chrono_literals;
0034 
0035     boost::thread thread([] {
0036         auto cout = [] (auto&& value) {
0037             std::cout << "Out: " << voy_fwd(value) << std::endl;
0038         };
0039 
0040         auto pipeline_delayed =
0041             voy::delayed(5s, "I'm finally here"s) | voy::sink{cout};
0042 
0043         voy::event_loop::run();
0044     });
0045 
0046     std::cout << "Doing something\n";
0047 
0048     thread.join();
0049 
0050     return 0;
0051 }
0052