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.)

 채택된 답변

Edric Ellis
Edric Ellis 2015년 6월 9일

0 개 추천

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

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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

질문:

2015년 6월 8일

댓글:

2015년 6월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by