Experience: Developing Cloud Foundry applications with D

Andre via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 5 22:45:17 PDT 2015


On Monday, 5 October 2015 at 15:51:09 UTC, Andre wrote:
> On Sunday, 4 October 2015 at 23:34:58 UTC, Rikki Cattermole 
> wrote:
>> On 05/10/15 8:13 AM, Andre wrote:
>
>> Vibe.d has a provider called libasync. Libasync is fully 
>> implemented in D. You probably should have tried that at least.
>> Although I still would recommend trying it ;) It's a lot 
>> better then what we have in Phobos.
>
> Looks good, it seems all external dependencies issues are gone 
> for vibe-d on Cloud Foundry. I haven't a working test 
> application so far but I think the issue is now releated to the 
> correct bind address in a Cloud Foundry environment.

As far as I understand vibe-d is not runnable out of the box in 
Cloud Foundry.
I cannot point directly to the issue, I just get the information, 
that the
test application does not accept connections during a health 
check run in the log file.

My simple test application is the example from the homepage 
except,
that the port is read from the environment variable PORT.

import vibe.d;

shared static this()
{
	import std.process: environment;
	auto settings = new HTTPServerSettings;
	settings.port = to!ushort(environment.get("PORT", "8080"));

	listenHTTP(settings, &handleRequest);
}

void handleRequest(HTTPServerRequest req,
                    HTTPServerResponse res)
{
	if (req.path == "/")
		res.writeBody("Hello, World!", "text/plain");
}

I assume some issues with memutils, but have no chance to 
validate this.
What I can see, if I run the application in my virtubox (Ubuntu) 
instead
of the Cloud Foundry, I get following reponse:

vagrant at vagrant-ubuntu-trusty-64:~/projects/tests/vibed_test$ dub
Target memutils 0.4.1 is up to date. Use --force to rebuild.
Target libasync 0.7.5 is up to date. Use --force to rebuild.
Target vibe-d 0.7.25 is up to date. Use --force to rebuild.
Building vibed_test ~master configuration "debug", build type 
debug.
Compiling using dmd...
Enhanced memory security is enabled.
Using Linux EPOLL for events
Linking...
Running ./bin/app
Listening for HTTP requests on :::8080
Listening for HTTP requests on 0.0.0.0:8080
E: Could not mlock 65536 bytes






More information about the Digitalmars-d mailing list