You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Everybody!
Sorry for a dump question. How do i manually specify the worker group where the coroutine should be placed?
classMyCoroutine : publicoatpp::async::CoroutineWithResult<MyCoroutine, const oatpp::Object<MessageDto>& /* result type */> {
private:
oatpp::Object<ProcessedMessageDto> m_dto_to_return = ProcessedMessageDto::createShared();
public:
Action act() override {
OATPP_LOGD("MyCoroutine", "entry point")
returnyieldTo(&MyCoroutine::readFileAndGetSize);
}
// I/O Operation
Action readFileAndGetSize() {
// READ FILE FROM FILESYSTEM AND GET ITS SIZE
m_dto_to_return->size = MyCustomStaticFileHandler::getFileSize();
returnyieldTo(&MyCoroutine::callulateFibonacciSequence);
}
// Data-Processing Opetation
Action callulateFibonacciSequence() {
// SOME PROCESSOR-DEPENDENT OPERATION
m_dto_to_return->fibonacci = MyCustomStaticFibonacciSequencer::getResult();
returnyieldTo(&MyCoroutine::checkResults);
}
Action checkResilts() {
OATPP_LOGD("MyCoroutine", "checked result")
return_return(m_dto_to_return);
}
};
This is an approximate example. Of course my service has multiple endpoint's with different logic: retrieving data from multipart requests, accessing database and some iterable operations (O(N)). How can i specify which worker should be loaded by the coroutine?
P.S. i found an issue where this question was partially raised. As i understood, by default an act() coroutine has a IO type. Some coroutines like waitRepeat() processes in timer worker. Is there any ways to define the group more "explicitly"?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi Everybody!
Sorry for a dump question. How do i manually specify the worker group where the coroutine should be placed?
This is an approximate example. Of course my service has multiple endpoint's with different logic: retrieving data from multipart requests, accessing database and some iterable operations (O(N)). How can i specify which worker should be loaded by the coroutine?
P.S. i found an issue where this question was partially raised. As i understood, by default an act() coroutine has a IO type. Some coroutines like waitRepeat() processes in timer worker. Is there any ways to define the group more "explicitly"?
Thanks in advance!
The text was updated successfully, but these errors were encountered: