Hi all,
n00b here, I have a project built with vibe using dub that is working perfectly. Now I need to implement a different tool (that will periodically run from crontab) and I would like to use vibe.http.client.requestHTTP to make some GET requests from the script. Is it possible? How? Should I compile vibe as a library? If yes, how?
Any suggestion is more than welcome,
dat
Am 10.08.2014 04:15, schrieb dat:
Hi all,
n00b here, I have a project built with vibe using dub that is working perfectly. Now I need to implement a different tool (that will periodically run from crontab) and I would like to use vibe.http.client.requestHTTP to make some GET requests from the script. Is it possible? How? Should I compile vibe as a library? If yes, how?
Any suggestion is more than welcome,
dat
I would just use DUB to build a binary (using dub build
). The binary
will have vibe.d statically linked in, so that doesn't need to be built
or deployed separately. For a short-living command line tool, you will
also probably want to specify "versions": ["VibeCustomMain"]
in the
project's dub.json and then define your own main()
function:
void main()
{
import vibe.http.client;
requestHTTP(...);
}
alternatively (with "VibeDefaultMain"
) it would currently be necessary
to explicitly call exitEventLoop()
:
shared static this()
{
import vibe.core.core;
import vibe.http.client;
runTask({
requestHTTP(...);
exitEventLoop();
});
}
Hope this helps.
On 8/14/2014 2:26 AM, Sönke Ludwig wrote:
Am 10.08.2014 04:15, schrieb dat:
Hi all,
n00b here, I have a project built with vibe using dub that is working
perfectly. Now I need to implement a different tool (that will
periodically run from crontab) and I would like to use
vibe.http.client.requestHTTP to make some GET requests from the
script. Is it possible? How? Should I compile vibe as a library? If
yes, how?
Any suggestion is more than welcome,
datI would just use DUB to build a binary (using
dub build
). The binary
will have vibe.d statically linked in,
As a package repo/tool, Dub really needs to play nicer with other
build systems. As it is, trying to use a dub-based package in a project
that uses anything other than dub as the build system is a royal PITA.
It's kinda the biggest thing really holding me back from actually using
dub much.
I will try as soon as possible.
Thanks!
Am 18.08.2014 21:45, schrieb Nick Sabalausky:
On 8/14/2014 2:26 AM, Sönke Ludwig wrote:
Am 10.08.2014 04:15, schrieb dat:
Hi all,
n00b here, I have a project built with vibe using dub that is working
perfectly. Now I need to implement a different tool (that will
periodically run from crontab) and I would like to use
vibe.http.client.requestHTTP to make some GET requests from the
script. Is it possible? How? Should I compile vibe as a library? If
yes, how?
Any suggestion is more than welcome,
datI would just use DUB to build a binary (using
dub build
). The binary
will have vibe.d statically linked in,As a package repo/tool, Dub really needs to play nicer with other
build systems. As it is, trying to use a dub-based package in a project
that uses anything other than dub as the build system is a royal PITA.
It's kinda the biggest thing really holding me back from actually using
dub much.
This would definitely be a task for someone who actually works with
mixed build systems. I'm more or less exclusively building pure DUB
projects (and some pure C++ ones). And since there is currently a lot of
work on my plate, I can't really afford to invest a lot of time for
things that wouldn't pay back. Well, hopefully that situation will relax
again in a while...