How to use event listners for notifications sent from parfeval functions?

Is it possible to trigger a notify event from a parfeval function with a listner in the calling client? So far my experiments with this have failed (but without telling me about any errors.)

 Accepted Answer

There currently isn't any support for events from parfeval futures. What sort of event support were you hoping for? Just a completion event?
For now, your best bet is call fetchNext in a loop, possibly with a timeout - although of course this doesn't give you the full flexibility that an event would.

3 Comments

Thanks Edric
To add a bit more to this - I have a process (a class method) that reads a bytestream in a perpetual loop decoding messages on the fly and triggering various events depending on the type of message. The data is streaming from LightStreamer. Event listners then handle the various messages and data appropriately. This works well and I thought it was a good design.
Now I want to read from multiple streams, but I can't just iterate over them as the data rates are different and a slow stream will block a fast one. So I thought I'd run each stream in a separate thread using parfeval. I suspect though that passing parfeval a function handle to an object method isn't going to work. Any alternative suggestions would be greatly appreciated.
Thanks for the information. You can pass object methods to parfeval, but that probably will not help you because the object handles on the workers are not connected back to the object handle at the client.
Neil, perhaps it would make more sense to use spmd and labSend() the data from the streams to the master lab that is coordinating everything.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!