Parfeval, Backgroundpool and Webread

8 ビュー (過去 30 日間)
Xymbu
Xymbu 2022 年 1 月 10 日
コメント済み: Raymond Norris 2022 年 2 月 17 日
I am trying to use parfeval to do a webread on a background pool and it responds with the message...
Invalid default value for property 'UserAgent' in class 'weboptions':Use of function version is not supported on a thread-based worker. Use alternatives supported on the background pool.
which I assume means I can't use webread with the background pool.
is there another way to do this?

採用された回答

Edric Ellis
Edric Ellis 2022 年 1 月 10 日
Unfortunately, as you suspect, right now the only way to do this is to use a process pool via parpool('local') or similar.
  2 件のコメント
Alex Alex
Alex Alex 2022 年 2 月 17 日
The message says that there are alternatives supported on the backgound pool. Could you give a hint what they are? matlab.net.http.RequestMessage? Thank you.
Raymond Norris
Raymond Norris 2022 年 2 月 17 日
As Edric suggests, use a local parallel pool.
pool = parpool("local",1);
f = pool.parfeval(@webread,1,'http://www.mathworks.com');
f.wait
size(f.fetchOutputs)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWeb Services についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by