Synchronous wxWebRequest ?

50 views
Skip to first unread message

Eric Jensen

unread,
Apr 6, 2021, 5:54:19 AM4/6/21
to wx-u...@googlegroups.com
Hi all,

i've been reading about wxWebRequest and it's nice to now have HTTPS
support without having to depend on libcurl, but it would be even
nicer if there was a synchronous version that could be used from
inside worker threads.

Would that be possible to add somehow? Or should i stay with libcurl
for that?

Regards,
Eric

Vadim Zeitlin

unread,
Apr 6, 2021, 4:58:22 PM4/6/21
to wx-u...@googlegroups.com
On Tue, 6 Apr 2021 11:54:04 +0200 Eric Jensen wrote:

EJ> i've been reading about wxWebRequest and it's nice to now have HTTPS
EJ> support without having to depend on libcurl, but it would be even
EJ> nicer if there was a synchronous version that could be used from
EJ> inside worker threads.

Hi Eric,

It's funny that you've posted this today, almost in parallel with the
thread "WebView async RunScript"[*] on wx-dev. Just shows that it's
difficult to make everybody happy at the same time :-/

[*]: https://groups.google.com/g/wx-dev/c/Dc_V_Y0IhlA

EJ> Would that be possible to add somehow? Or should i stay with libcurl
EJ> for that?

I've decided we could always add sync API later on top of the async one,
but that the first version didn't need it. This clearly won't happen before
3.1.5, but we're almost certainly going to have 3.1.6 too and if we could
have sync wrappers in it, it would certainly be helpful. I think they
should be pretty simple to add as all backends just end up calling
SetState() and so all that would need to be done would be to make it set a
flag and signal a condition instead of something using CallAfter() in the
"sync" case.

Obviously, any PRs implementing this would be more welcome!

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Reply all
Reply to author
Forward
0 new messages