Can I notify a listener from a batch job?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 25 Aug. 2021
Beantwortet: MathWorks Support Team
am 7 Okt. 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?
Akzeptierte Antwort
MathWorks Support Team
am 25 Aug. 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 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!