-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove const
from AsyncProgressWorker::Signal
and AsyncProgressQueueWorker::Signal
#1086
Conversation
Hi @JosephusPaye , Thanks for your PR! We discussed this inside today's Node.js API meeting. Looking back at your original issue, you say the // 2. https://github.com/nodejs/node-addon-api/blob/4351bffd537eab927226bf6f9b66cd385a049a43/napi-inl.h#L5876
template<class T>
inline void AsyncProgressWorker<T>::Signal() const {
this->NonBlockingCall(static_cast<T*>(nullptr));
}
// 3. https://github.com/nodejs/node-addon-api/blob/4351bffd537eab927226bf6f9b66cd385a049a43/napi-inl.h#L5725
template <typename DataType>
inline napi_status AsyncProgressWorkerBase<DataType>::NonBlockingCall(DataType* data) {
auto tsd = new AsyncProgressWorkerBase::ThreadSafeData(this, data);
return _tsfn.NonBlockingCall(tsd, OnAsyncWorkProgress);
} Have you thought about making the method in point three Thanks, Kevin |
Hi Kevin, I went ahead and tried adding
|
It also appears |
Hi @JosephusPaye , We reviewed both of your issues here (the @legendecas will take a further look into the implementation of why |
Sounds good! |
Co-authored-by: legendecas <legendecas@gmail.com>
This PR fixes #1081 by removing
const
from theAsyncProgressWorker::Signal
andAsyncProgressQueueWorker::Signal
methods, and also from theExecutionProgress
parameter of theExecute
method (this one might be a breaking change).Also added a test for the
AsyncProgressWorker::Signal
.EDIT: Test added, butAsyncProgressQueueWorker::Signal
needs to be tested as well.AsyncProgressQueueWorker::Signal()
doesn't work, needs fixing.