Can I notify a listener from a batch job?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 25 Août 2021
Réponse apportée : MathWorks Support Team
le 7 Oct 2021
I have an App Designer application where I need to launch a computational routine in the background while a user can still click around and use the app. I tried implementing a listener and notifying the listener in the batch job, but the listener was never triggered. However, when I call this in process (without batch), the listener is triggered.
How can I configure this listener properly?
Réponse acceptée
MathWorks Support Team
le 25 Août 2021
Unfortunately you cannot trigger a listener from a batch job. However, as a workaround, you can use the parfeval function in conjunction with DataQueues .
A DataQueue object allows you to asynchronously share data between workers in a parallel pool and the client (in this case, the App Designer application). You can call parfeval instead of batch to run your desired function asynchronously while still allowing the end user to interact with the application. You can specify which function to call after data is received by the DataQueue using the afterEach function.
To actually send data to the DataQueue, call the send function from within the function that you're submitting as a batch job.
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!