Closed mw66 closed 4 years ago
and another newbie Q:
When dlang-requests is compiled with support for vibe.d sockets (--config=vibed)
where to specify this build option --config=vibed? I'm using dub.
Maybe this info should also be put in the doc.
In this section, it's said:
https://github.com/ikod/dlang-requests/blob/master/README.md#vibed
You can safely use dlang-requests with vibe.d. When dlang-requests is compiled with support for vibe.d sockets (--config=vibed), each call to dlang-requests API can block only the current fiber, not the thread:
Does this means: -- with std.socket: the network IO is normal (sync) function call which will block the current calling thread. -- with vibe.d: the network IO is wrapped async fiber call (via vibe.d), so, it can block only the current fiber, not the current thread.
Yes, you are correct. In "vibed" mode
requests
use vibe "non-blocling" sockets.If yes, I think this is very import library usage guide to the (new) user (like me), and this section should be moved to the top, as an subsection of right here: Library configurations, and emphasize this important difference.
Ok, thanks! Will add few lines.
https://github.com/ikod/dlang-requests/blob/master/README.md#library-configurations
Thanks.
and another newbie Q:
When dlang-requests is compiled with support for vibe.d sockets (--config=vibed)
where to specify this build option --config=vibed? I'm using dub.
I your dub.file just insert few lines
"dependencies": {
"requests": "~>1"
},
"subConfigurations": {
"requests": "vibed"
}
But you also have actually write vibe application, not just mention this dependency and mode.
Maybe this info should also be put in the doc.
In this section, it's said:
https://github.com/ikod/dlang-requests/blob/master/README.md#vibed
Does this means: -- with std.socket: the network IO is normal (sync) function call which will block the current calling thread. -- with vibe.d: the network IO is wrapped async fiber call (via vibe.d), so, it can block only the current fiber, not the current thread.
If yes, I think this is very import library usage guide to the (new) user (like me), and this section should be moved to the top, as an subsection of right here: Library configurations, and emphasize this important difference.
https://github.com/ikod/dlang-requests/blob/master/README.md#library-configurations
Thanks.