Hello Nodepp dev. team! I have simple worker function I started using this code:
nodepp::worker::add( [&] () -> int {
...
// initialization of http server done here
...
nodepp::process::wait();
return -1;
} );
I tried to initialize http/ws servers and/or clients in it. Everything works OK.
Then I tried to add more workload into it using timer or periodic task. Basic timer:
auto a_timer = nodepp::timer::interval( [&] () {
...
}, 100 );
Or similar periodic task:
nodepp::process::add( [&] () -> int {
...
return 1; // return 1 -> will repeat the task
} );
Any of these quick executing periodic tasks make even loop stuck in kevent call(Mac OSX):
inline int next() const {
...
/* IO DETECTION */
obj->idx=kevent( obj->pd, NULL, 0, &obj->ev, obj->ev.size(), &get_delay_tm() ); <<<< STUCK HERE
if( obj->idx <= 0 ){ return 1; }
...
Perodic task can have empty code. So, my code does not affect to stuck behavior. Just starting timer or periodic function call is enough to reproduce the problem. You need to have at least one http server and at least one periodic task of any kind. Just start periodic task before starting http server.
Hello Nodepp dev. team! I have simple worker function I started using this code:
I tried to initialize http/ws servers and/or clients in it. Everything works OK.
Then I tried to add more workload into it using timer or periodic task. Basic timer:
Or similar periodic task:
Any of these quick executing periodic tasks make even loop stuck in
keventcall(Mac OSX):Perodic task can have empty code. So, my code does not affect to stuck behavior. Just starting timer or periodic function call is enough to reproduce the problem. You need to have at least one http server and at least one periodic task of any kind. Just start periodic task before starting http server.