@@ -169,88 +169,88 @@ int main () {
169169 using http = manapi::net::http::server;
170170 // auto db = manapi::ext::pq::connection::create().unwrap();
171171
172- /* *
173- * grpc
174- */
175-
176- auto thrcntind = thrcnt.fetch_add (1 );
177-
178- auto service = std::make_shared<GreeterServiceImpl>();
179-
180- auto grpc_server = manapi::net::wgrpc::server::create (grpc_server_ctx).unwrap ();
181- manapi::async::run ([grpc_server, service, thrcntind] () mutable -> manapi::future<> {
182- auto res = co_await grpc_server.config (" /home/Timur/Desktop/WorkSpace/ManapiHTTP/cmake-build-debug/grpc.json" );
183-
184- res.log ();
185-
186- res = co_await grpc_server.start ([&] (grpc::ServerBuilder &builder) -> manapi::error::status {
187- builder.RegisterService (service.get ());
188- return manapi::error::status_ok ();
189- });
190-
191- res.log ();
192- assert (res.ok ());
193- if (res.ok ()) {
194- auto creds = co_await manapi::net::wgrpc::secure_channel_credentials (" /home/Timur/Documents/ssl/quic/cert.crt" );
195- if (!creds.ok ()) {
196- creds.err ().log ();
197- co_return ;
198- }
199- auto greeter = std::make_shared<GreeterClient>(grpc::CreateChannel (" localhost:8080" , creds.unwrap ()));
200- manapi::async::current ()->timerpool ()->append_interval_async (100 , [greeter] (const manapi::timer &t) -> manapi::future<> {
201- std::string user = " Xiadnoring Client #1" ;
202- auto res = co_await greeter->SayHello (user);
203- if (res.ok ())
204- std::cout << " Xiadnoring Client#1 =" << res.unwrap () << " \n " ;
205- else
206- res.err ().log ();
207- });
208- manapi::async::current ()->timerpool ()->append_interval_async (100 , [greeter] (const manapi::timer &t) -> manapi::future<> {
209- std::string user = " Xiadnoring Client #2" ;
210- auto res = co_await greeter->SayHello (user);
211- if (res.ok ())
212- std::cout << " Xiadnoring Client #2=" << res.unwrap () << " \n " ;
213- else
214- res.err ().log ();
215- });
216- manapi::async::current ()->timerpool ()->append_interval_async (100 , [greeter] (const manapi::timer &t) -> manapi::future<> {
217- std::string user = " Xiadnoring Client #3" ;
218- auto res = co_await greeter->SayHello (user);
219- if (res.ok ())
220- std::cout << " Xiadnoring Client #3=" << res.unwrap () << " \n " ;
221- else
222- res.err ().log ();
223- });
224- manapi::async::current ()->timerpool ()->append_interval_async (100 , [greeter] (const manapi::timer &t) -> manapi::future<> {
225- std::string user = " Xiadnoring Client #4" ;
226- auto res = co_await greeter->SayHello (user);
227- if (res.ok ())
228- std::cout << " Xiadnoring Client #4=" << res.unwrap () << " \n " ;
229- else
230- res.err ().log ();
231- });
232- manapi::async::current ()->timerpool ()->append_interval_async (100 , [greeter] (const manapi::timer &t) -> manapi::future<> {
233- std::string user = " Xiadnoring Client #5" ;
234- auto res = co_await greeter->SayHello (user);
235- if (res.ok ())
236- std::cout << " Xiadnoring Client #5=" << res.unwrap () << " \n " ;
237- else
238- res.err ().log ();
239- });
240- manapi::async::current ()->timerpool ()->append_interval_async (100 , [greeter] (const manapi::timer &t) -> manapi::future<> {
241- std::string user = " Xiadnoring Client #6" ;
242- auto res = co_await greeter->SayHello (user);
243- if (res.ok ())
244- std::cout << " Xiadnoring Client #6=" << res.unwrap () << " \n " ;
245- else
246- res.err ().log ();
247- });
248- }
249-
250- }, [] (std::exception_ptr err) -> void {
251- if (err)
252- std::rethrow_exception (err);
253- });
172+ // / **
173+ // * grpc
174+ // */
175+ //
176+ // auto thrcntind = thrcnt.fetch_add(1);
177+ //
178+ // auto service = std::make_shared<GreeterServiceImpl>();
179+ //
180+ // auto grpc_server = manapi::net::wgrpc::server::create (grpc_server_ctx).unwrap();
181+ // manapi::async::run([grpc_server, service, thrcntind] () mutable -> manapi::future<> {
182+ // auto res = co_await grpc_server.config("/home/Timur/Desktop/WorkSpace/ManapiHTTP/cmake-build-debug/grpc.json");
183+ //
184+ // res.log();
185+ //
186+ // res = co_await grpc_server.start([&] (grpc::ServerBuilder &builder) -> manapi::error::status {
187+ // builder.RegisterService(service.get());
188+ // return manapi::error::status_ok();
189+ // });
190+ //
191+ // res.log();
192+ // assert(res.ok());
193+ // if (res.ok()) {
194+ // auto creds = co_await manapi::net::wgrpc::secure_channel_credentials("/home/Timur/Documents/ssl/quic/cert.crt");
195+ // if (!creds.ok()) {
196+ // creds.err().log();
197+ // co_return;
198+ // }
199+ // auto greeter = std::make_shared<GreeterClient>(grpc::CreateChannel("localhost:8080", creds.unwrap()));
200+ // manapi::async::current()->timerpool()->append_interval_async(100, [greeter] (const manapi::timer &t) -> manapi::future<> {
201+ // std::string user = "Xiadnoring Client #1";
202+ // auto res = co_await greeter->SayHello(user);
203+ // if (res.ok())
204+ // std::cout << "Xiadnoring Client#1 =" << res.unwrap() << "\n";
205+ // else
206+ // res.err().log();
207+ // });
208+ // manapi::async::current()->timerpool()->append_interval_async(100, [greeter] (const manapi::timer &t) -> manapi::future<> {
209+ // std::string user = "Xiadnoring Client #2";
210+ // auto res = co_await greeter->SayHello(user);
211+ // if (res.ok())
212+ // std::cout << "Xiadnoring Client #2=" << res.unwrap() << "\n";
213+ // else
214+ // res.err().log();
215+ // });
216+ // manapi::async::current()->timerpool()->append_interval_async(100, [greeter] (const manapi::timer &t) -> manapi::future<> {
217+ // std::string user = "Xiadnoring Client #3";
218+ // auto res = co_await greeter->SayHello(user);
219+ // if (res.ok())
220+ // std::cout << "Xiadnoring Client #3=" << res.unwrap() << "\n";
221+ // else
222+ // res.err().log();
223+ // });
224+ // manapi::async::current()->timerpool()->append_interval_async(100, [greeter] (const manapi::timer &t) -> manapi::future<> {
225+ // std::string user = "Xiadnoring Client #4";
226+ // auto res = co_await greeter->SayHello(user);
227+ // if (res.ok())
228+ // std::cout << "Xiadnoring Client #4=" << res.unwrap() << "\n";
229+ // else
230+ // res.err().log();
231+ // });
232+ // manapi::async::current()->timerpool()->append_interval_async(100, [greeter] (const manapi::timer &t) -> manapi::future<> {
233+ // std::string user = "Xiadnoring Client #5";
234+ // auto res = co_await greeter->SayHello(user);
235+ // if (res.ok())
236+ // std::cout << "Xiadnoring Client #5=" << res.unwrap() << "\n";
237+ // else
238+ // res.err().log();
239+ // });
240+ // manapi::async::current()->timerpool()->append_interval_async(100, [greeter] (const manapi::timer &t) -> manapi::future<> {
241+ // std::string user = "Xiadnoring Client #6";
242+ // auto res = co_await greeter->SayHello(user);
243+ // if (res.ok())
244+ // std::cout << "Xiadnoring Client #6=" << res.unwrap() << "\n";
245+ // else
246+ // res.err().log();
247+ // });
248+ // }
249+ //
250+ // }, [] (std::exception_ptr err) -> void {
251+ // if (err)
252+ // std::rethrow_exception(err);
253+ // });
254254
255255 /* *
256256 * http
0 commit comments