Re: [I] brpcServer 异步处理 (brpc)

2023-11-26 Thread via GitHub


thorneliu commented on issue #2446:
URL: https://github.com/apache/brpc/issues/2446#issuecomment-1827006471

   > > > 那么是在Echo 处理函数中回复了Echo response,同时启动一个线程来运行你的业务函数就行了吧
   > > 
   > > 
   > > 想了解brpc有没有预留这样的借口,自己起线程,感觉在程序退出时,可能会有资源访问core问题
   > 
   > 运行done->Run()后request和response都会被析构,如果在单独业务线程中会访问req和resp会有问题
   
   Hi,如果是这样,你应该拓展done的生命周期,类似这样:
   ```
   void ChatServiceImpl::Syn(google::protobuf::RpcController *cntl_base,
 const HttpRequest *, HttpResponse *,
 google::protobuf::Closure *done) {
   
   auto job = std::make_shared();
 ...
 job->cntl = cntl;
 job->done = done_guard.release();
   
 infer_job_scheduler_->noNewJob(job);
 ...
   }
   
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org



Re: [I] brpcServer 异步处理 (brpc)

2023-11-21 Thread via GitHub


leaf-potato commented on issue #2446:
URL: https://github.com/apache/brpc/issues/2446#issuecomment-1822183144

   > > 那么是在Echo 处理函数中回复了Echo response,同时启动一个线程来运行你的业务函数就行了吧
   > 
   > 想了解brpc有没有预留这样的借口,自己起线程,感觉在程序退出时,可能会有资源访问core问题
   
   运行done->Run()后request和response都会被析构,如果在单独业务线程中会访问req和resp会有问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org



Re: [I] brpcServer 异步处理 (brpc)

2023-11-21 Thread via GitHub


yming000 commented on issue #2446:
URL: https://github.com/apache/brpc/issues/2446#issuecomment-1822018186

   > 看下这个#2328 满足需求吗
   
   谢谢 我学习一下


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org



Re: [I] brpcServer 异步处理 (brpc)

2023-11-21 Thread via GitHub


yming000 commented on issue #2446:
URL: https://github.com/apache/brpc/issues/2446#issuecomment-1820743780

   > 那么是在Echo 处理函数中回复了Echo response,同时启动一个线程来运行你的业务函数就行了吧
   
   想了解brpc有没有预留这样的借口,自己起线程,感觉在程序退出时,可能会有资源访问core问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org



Re: [I] brpcServer 异步处理 (brpc)

2023-11-17 Thread via GitHub


thorneliu commented on issue #2446:
URL: https://github.com/apache/brpc/issues/2446#issuecomment-1816092228

   那么是在Echo 处理函数中回复了Echo response,同时启动一个线程来运行你的业务函数就行了吧


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org



Re: [I] brpcServer 异步处理 (brpc)

2023-11-14 Thread via GitHub


leaf-potato commented on issue #2446:
URL: https://github.com/apache/brpc/issues/2446#issuecomment-1811898497

   看下这个https://github.com/apache/brpc/pull/2328 满足需求吗


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org