Re: vibe.d / experience / feedback

2020-09-30 Thread mipri via Digitalmars-d-learn
On Thursday, 1 October 2020 at 06:32:23 UTC, Robert M. Münch wrote: 5. One can't access the raw HTTP request body, things must be go through Vibe's JSON parser. To get access to the raw body, a lot of workarounds are necessary. given an HTTPServerRequest req, req.bodyReader.readAll for binary

vibe.d / experience / feedback

2020-09-30 Thread Robert M . Münch via Digitalmars-d-learn
Hi, we are currently using vibe.d for a prototype and I want to post some experiences. I know one shouldn't only address the problems but provide some solutions. However, our current use-case is that we want to get a job done, and not creating a web-framework. 1. For many things the docs are mi

Re: Fiber based HTTP client for load testing

2020-09-30 Thread ikod via Digitalmars-d-learn
On Thursday, 1 October 2020 at 03:10:32 UTC, ikod wrote: On Thursday, 1 October 2020 at 00:35:49 UTC, Arun wrote: I have a REST client that can do load test of my REST void main() { auto urls = ["http://httpbin.org/";, "http://httpbin.org/image";]; foreach(url; urls) { r

Re: Fiber based HTTP client for load testing

2020-09-30 Thread ikod via Digitalmars-d-learn
On Thursday, 1 October 2020 at 00:35:49 UTC, Arun wrote: I have a REST client that can do load test of my REST services. It uses ikod's dlang-requests under the hood. https://github.com/ikod/dlang-requests At the moment I use a thread pool to dispatch the runtime operation and send the reques

Re: Fiber based HTTP client for load testing

2020-09-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/30/20 8:35 PM, Arun wrote: As seen, the downside is that the more threads we use the more memory the app consumes. Is there a way to replace the threads with fibers in this particular case so that instead of spawning 1000 threads, we spawn 1000 fibers with just 1 thread? Right on the

Fiber based HTTP client for load testing

2020-09-30 Thread Arun via Digitalmars-d-learn
I have a REST client that can do load test of my REST services. It uses ikod's dlang-requests under the hood. https://github.com/ikod/dlang-requests At the moment I use a thread pool to dispatch the runtime operation and send the requests to the server. /// Iterates over the enum members

Re: What classification should shared objects in qeued thread pools have?

2020-09-30 Thread mw via Digitalmars-d-learn
On Thursday, 1 October 2020 at 00:13:41 UTC, IGotD- wrote: I think that the shared in shared structs should not be transitive to members of the struct. The compiler should not Once the aggregate struct data is decl-ed `shared` as a whole, it needs to be transitive to play safe. The compiler

Re: What classification should shared objects in qeued thread pools have?

2020-09-30 Thread IGotD- via Digitalmars-d-learn
On Thursday, 1 October 2020 at 00:00:06 UTC, mw wrote: I think using `shared` is the D's encouraged way. If there is a better way do this in D, I'd want to know it too. I think that the shared in shared structs should not be transitive to members of the struct. The compiler should not enfo

Re: What classification should shared objects in qeued thread pools have?

2020-09-30 Thread mw via Digitalmars-d-learn
On Thursday, 1 October 2020 at 00:00:06 UTC, mw wrote: On Wednesday, 30 September 2020 at 20:13:47 UTC, IGotD- wrote: [...] I think declaring the container and item as `shared` is the D's encouraged way of sharing data among different threads. [...] then just cast the `shared` away: cast

Re: What classification should shared objects in qeued thread pools have?

2020-09-30 Thread mw via Digitalmars-d-learn
On Wednesday, 30 September 2020 at 20:13:47 UTC, IGotD- wrote: This where the memory model of D starts to become confusing for me. By default memory allocations/deallocation are not allowed between threads, however setting the object to shared circumvents this. This seems to work as there is no

What classification should shared objects in qeued thread pools have?

2020-09-30 Thread IGotD- via Digitalmars-d-learn
I have a system that heavily relies on thread pools. Typically this is used with items that are put on a queue and then a thread pool system process this queue. The thread pool can be configured to process the items in whatever parallel fashion it wants but usually it is set to one, that means

Re: vibe.de multiple ports.

2020-09-30 Thread aberba via Digitalmars-d-learn
On Wednesday, 30 September 2020 at 12:38:10 UTC, seany wrote: On Wednesday, 30 September 2020 at 12:29:06 UTC, Daniel Kozak wrote: Dne st 30. 9. 2020 13:25 uživatel seany via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> napsal: Hello I am trying to use this example for a iot app

Re: Deprecation in traits

2020-09-30 Thread Ben Jones via Digitalmars-d-learn
On Wednesday, 30 September 2020 at 18:18:48 UTC, Basile B. wrote: On Tuesday, 29 September 2020 at 17:08:40 UTC, Frak wrote: Hi folks, I've this: /Users/frak/dlang/ldc-1.23.0/bin/../import/std/traits.d(3711): Deprecation: function `std.typecons.Nullable!long.Nullable.get_` is deprecated - I

Re: Deprecation in traits

2020-09-30 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 17:08:40 UTC, Frak wrote: Hi folks, I've this: /Users/frak/dlang/ldc-1.23.0/bin/../import/std/traits.d(3711): Deprecation: function `std.typecons.Nullable!long.Nullable.get_` is deprecated - Implicit conversion with `alias Nullable.get this` will be removed

Re: vibe.de multiple ports.

2020-09-30 Thread Daniel Kozak via Digitalmars-d-learn
On Wed, Sep 30, 2020 at 2:40 PM seany via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Wednesday, 30 September 2020 at 12:29:06 UTC, Daniel Kozak > wrote: > > to separate the messages from the IoT responses quickly and > forward them to different programs, and to have the c

Re: Deprecation in traits

2020-09-30 Thread Frak via Digitalmars-d-learn
On Wednesday, 30 September 2020 at 09:42:40 UTC, Stefan Koch wrote: On Wednesday, 30 September 2020 at 08:33:58 UTC, Frak wrote: On Tuesday, 29 September 2020 at 18:25:03 UTC, Steven Schveighoffer wrote: On 9/29/20 1:08 PM, Frak wrote: [...] Because it's probably coming from a constraint, yo

Re: vibe.de multiple ports.

2020-09-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 30 September 2020 at 11:23:59 UTC, seany wrote: auto router = new URLRouter; router.post("/archive", &savedata); router.get("/archive", &savedata); auto settings = new HTTPServerSettings; settings.port = port; settings.bindAddresses

Re: vibe.de multiple ports.

2020-09-30 Thread seany via Digitalmars-d-learn
On Wednesday, 30 September 2020 at 12:29:06 UTC, Daniel Kozak wrote: Dne st 30. 9. 2020 13:25 uživatel seany via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> napsal: Hello I am trying to use this example for a iot application: https://aberba.com/2018/using-vibe-d-web-interface/

Re: vibe.de multiple ports.

2020-09-30 Thread Daniel Kozak via Digitalmars-d-learn
Dne st 30. 9. 2020 13:25 uživatel seany via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> napsal: > Hello > > I am trying to use this example for a iot application: > https://aberba.com/2018/using-vibe-d-web-interface/ > > The code i use is: > > ushort port = 5504; >

Re: Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.

2020-09-30 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 21:22:21 UTC, WhatMeWorry wrote: module user; export { int myAddSeven(int a, int b); } [...] it is better to use this template https://github.com/dlang/dmd/tree/master/samples/mydll You don't have a DllMain.

vibe.de multiple ports.

2020-09-30 Thread seany via Digitalmars-d-learn
Hello I am trying to use this example for a iot application: https://aberba.com/2018/using-vibe-d-web-interface/ The code i use is: ushort port = 5504; void main(char[][] args) { auto router = new URLRouter; router.post("/archive", &savedata); rou

Re: Deprecation in traits

2020-09-30 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 30 September 2020 at 08:33:58 UTC, Frak wrote: On Tuesday, 29 September 2020 at 18:25:03 UTC, Steven Schveighoffer wrote: On 9/29/20 1:08 PM, Frak wrote: [...] Because it's probably coming from a constraint, you probably can't figure out the exact usage. What's more annoying is

Re: Deprecation in traits

2020-09-30 Thread Frak via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 18:25:03 UTC, Steven Schveighoffer wrote: On 9/29/20 1:08 PM, Frak wrote: Hi folks, I've this: /Users/frak/dlang/ldc-1.23.0/bin/../import/std/traits.d(3711): Deprecation: function `std.typecons.Nullable!long.Nullable.get_` is deprecated - Implicit conversion