Can I notify a listener from a batch job?

1 visualización (últimos 30 días)
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?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 25 de Ag. de 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.

Más respuestas (0)

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by