-
-
Notifications
You must be signed in to change notification settings - Fork 493
Remove const from AsyncProgressWorker::Signal and AsyncProgressQueueWorker::Signal
#1086
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
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
constfrom theAsyncProgressWorker::SignalandAsyncProgressQueueWorker::Signalmethods, and also from theExecutionProgressparameter of theExecutemethod (this one might be a breaking change).Also added a test for the
AsyncProgressWorker::Signal.EDIT: Test added, butAsyncProgressQueueWorker::Signalneeds to be tested as well.AsyncProgressQueueWorker::Signal()doesn't work, needs fixing.