Re: Send data structures between threads?

2016-08-25 Thread Araq
> How do I avoid accidentally trashing the refcounts? protect and dispose only give you a `pointer` that you can cast to `ptr JsonObj` and so RCs are not affected. > But as you mentioned before, I can force it with a cast. Is that part of the > solution you're suggesting? Well yes. But you

Re: Where do I learn how to program Nim without a GC?

2016-08-25 Thread Araq
Compile with `--gc:stack` var rx: Region withRegion rx: ... json code here ... You're right though that it needs documentation. I don't even know if it's in 0.14.

GD Designs Rochdale Reviews (16)

2016-08-25 Thread azmirbogovic
GD Designs Rochdale Reviews (16) . Looks fab and was half price of other companies. Barry Fairhurst

Re: asynchttpserver and big request body

2016-08-25 Thread _tulayang
@vega I think it is different between io of httpserver and stand stream. readChar readData ... are not useful. I think we need apis like recvOnClientError recvOnAChunk recvOn100Continue recvOnTimeout etc.

Re: Send data structures between threads?

2016-08-25 Thread jyelon
Say, I never did get an answer to either of the questions above. I'm still curious: 1\. If the json is stored in a thread-local heap, then I let other threads reference the json, those other threads are going to tend to touch the refcounts. But the refcounts, presumably, aren't atomic ints.

Re: Where do I learn how to program Nim without a GC?

2016-08-25 Thread jyelon
Yeah, but he needs information on how to cause an normally garbage-collected library (for example, the JSON library) to allocate out of a memory region, without changing the code for the library. I think the real answer is: I don't think memory regions are implemented yet, I don't think

Re: Where do I learn how to program Nim without a GC?

2016-08-25 Thread flyx
> I mean somehow I have to tell Nim when to free memory right? Yeah sure, you just use these: [alloc](http://forum.nim-lang.org///nim-lang.org/docs/system.html#alloc,Natural), [dealloc](http://forum.nim-lang.org///nim-lang.org/docs/system.html#dealloc,pointer),

Re: Where do I learn how to program Nim without a GC?

2016-08-25 Thread Maxxi
Araq, I dont understand. I'm just now looking into Nimlang. How would I have to change the programming style to program with memory regions in Nim? It can't just be a flag to the compiler, I mean somehow I have to tell Nim when to free memory right?

Re: asynchttpserver and big request body

2016-08-25 Thread vega
WIP is here: [https://github.com/vegansk/asyncstreams](https://github.com/vegansk/asyncstreams)

Re: httpclient extraHeaders not working

2016-08-25 Thread euant
@dom96: That reminds me that I was going to submit a PR for that...

Re: Nim in Action is now available!

2016-08-25 Thread dom96
Last chance to get 50% off Nim in Action! Use code `pbbutcherlt`: [https://manning.com/books/nim-in-action?a_aid=niminaction_bid=78a27e81](https://manning.com/books/nim-in-action?a_aid=niminaction_bid=78a27e81)

Re: Nim in Action is now available!

2016-08-25 Thread dom96
> Hi @dom96! > Just ordered the book. Thank you for the discount! Thank you for ordering it! > Because now to understand which methods for example the seq type supports the > fastest is to use Internet search. setLen is in system, some others are in > sequtils and etc.etc. Keep reading, i'm

Re: asynchttpserver and big request body

2016-08-25 Thread dom96
> Thats why I want to write asyncstreams module for the standard library. What > do you think about it? Sounds like a good idea :)

Re: asynchttpserver and big request body

2016-08-25 Thread vega
I created the fork of asynchttpserver for the test: [https://github.com/vegansk/asynchttpserver2](https://github.com/vegansk/asynchttpserver2) where you can read entire body using `request.body.readAll`, get the length of the request without reading it via `request.body.len`. And the main

Re: asynchttpserver and big request body

2016-08-25 Thread _tulayang
Suggest to export the data received at each time, so that users can use this api to customize how their datas are stored (copy to their buffer or disk files).