Commit graph

39 commits

Author SHA1 Message Date
def
84315c6a9c Revert "Introduce FutureVar[T] to make recvLineInto safer."
This reverts commit 72b4912c84.
2015-04-26 17:01:04 +02:00
Dominik Picheta
72b4912c84 Introduce FutureVar[T] to make recvLineInto safer.
FutureVar[T] is a new distinct Future type which is designed to be used
for situations where the highest performance is needed. It reduces the
number of Future allocations needed. It acts as a replacement for
'var' params in async procs.

This commit modifies @def-'s PR in order to make it safer. The recvLineInto
procedure has been modified to take a ``FutureVar[string]`` param instead of a
``ptr string`` param.
2015-04-24 17:56:04 +01:00
Dominik Picheta
62e1b3e2e3 Some small cleanup. 2015-04-23 21:57:33 +01:00
Dominik Picheta
03cbf689a1 Merge branch 'clean-speedup-2' of https://github.com/def-/Nim into def--clean-speedup-2 2015-04-23 15:26:39 +01:00
Oleh Prypin
32109a7867 Don't run non-test code when defined(testing) 2015-04-21 14:37:29 +03:00
def
6523d80211 Rename clearStringTable to clear 2015-03-17 22:48:34 +01:00
def
2410e667bc Make respond a template again 2015-03-17 22:05:10 +01:00
def
e127ed77b1 Make recvLineInto a proc instead of template 2015-03-17 19:40:22 +01:00
def
43ed83384c Rename resetStringTable to clearStringTable 2015-03-17 19:40:22 +01:00
def
58c29c29ae Remove unused newRequest proc 2015-03-17 19:40:22 +01:00
def
6830c65560 Document asynchttpserver's respond template 2015-03-17 19:40:22 +01:00
def
477b3594eb Speed up asynchttpserver significantly using all the previous changes
- Export socket field of AsyncHttpServer and addHeaders proc for templates

- Make respond a template instead of proc because of how often it's called.
  This means no more "await" when invoking it.

- Optimize respond template with special case for empty headers and
  Content-Length entry

- newRequest doesn't allocate a hostname and body anymore because they're
  copied in later

- Major changes to processClient to prevent allocations and copies
2015-03-17 19:39:02 +01:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00
def
2d20feb8f1 Add imports to asynchttpserver example 2014-12-29 22:27:31 +01:00
Dominik Picheta
32db6798a3 Fixes asynchttpsever. 2014-12-26 19:47:25 +00:00
Dominik Picheta
9471f585c2 Fixes deprecation warnings in asynchttpserver. 2014-12-26 16:53:19 +00:00
Dominik Picheta
e4a5b1af6c Added more HTTP status codes to asynchttpserver. 2014-12-26 16:48:53 +00:00
Dominik Picheta
8f89c30fdd Ensure Request.body is initialised. 2014-11-17 19:53:44 +00:00
Dominik Picheta
13e3c0d5bb Implement SO_REUSEADDR for asyncnet and asynchttpserver. 2014-11-07 14:48:11 +00:00
Dominik Picheta
efca06c71c Add bool to determine if socket has been closed. 2014-09-16 16:37:53 +01:00
Dominik Picheta
6f155af802 Lots of documentation improvements for asyncdispatch.
Ref #1487.
2014-09-12 22:54:02 +01:00
Dominik Picheta
00b6a14489 More empty stmt fixes. 2014-09-09 15:58:44 +01:00
Dominik Picheta
6e321f799a Fixes asynchttpserver. 2014-09-01 21:21:13 +01:00
Dominik Picheta
361657dea4 Merge branch 'devel' into bigbreak
Conflicts:
	lib/pure/ftpclient.nim
2014-08-30 11:58:54 +01:00
Araq
11b6958755 big rename 2014-08-27 23:42:51 +02:00
Dominik Picheta
2dff5ef718 Fixed gcsafe in asynchttpserver module. 2014-08-21 20:36:27 +01:00
Araq
62e454f41b asynchttpserver compiles again; made some tests green 2014-08-13 01:16:18 +02:00
Dominik Picheta
eb6ac2a901 Asynchttpserver now uses new uri module for URL parsing. 2014-08-10 10:54:59 +01:00
Dominik Picheta
4f5f98f0b1 Fixes incorrect async exception handling. Adds sleepAsync.
The tasyncexceptions test has been added which tests for this incorrect
exception handling behaviour. The problem was that the exception was
raised inside a callback which was called from a previously finished async
procedure. This caused a "Future already finished" error. The fix was to
simply reraise the exception if the retFutureSym is already finished.

sleepAsync was added to help with the reproduction of this test. It should
also be useful for users however.

Finally some debug information was added to futures to help with future
bugs.
2014-08-09 17:13:22 +01:00
Dominik Picheta
cdcdab49b7 Fix broken async tests. 2014-07-13 11:02:34 +01:00
Dominik Picheta
374706b1c3 Void futures are no longer discardable. 2014-07-13 10:19:48 +01:00
Dominik Picheta
cf5c8a204e Many async optimisations.
* Selectors implementation will now attempt to immediately execute an IO
  operation instead of waiting for a ready notification.
* Removed recursion in asynchttpserver.
* Improved buffered implementation of recvLine in asyncnet.
* Optimised ``respond`` in asynchttpserver removing a possible "Delayed ACK"
  situation.
2014-07-12 22:51:06 +01:00
Dominik Picheta
f830aed869 AsyncHttpServer now supports POST. 2014-06-28 13:08:11 +01:00
Dominik Picheta
7ebbc09578 Allow async lambdas. Other socket modifications. 2014-06-19 00:05:27 +01:00
Dominik Picheta
6c4870d812 Get rid unsafe pointer type in GetQueuedCompletionStatus. 2014-04-30 17:38:44 +01:00
Dominik Picheta
3612aca5fe Implemented buffering for asynchronous sockets. 2014-04-13 14:18:47 +01:00
Andreas Rumpf
fe387888bd fixes for asynchttpserver 2014-04-13 00:39:15 +02:00
Dominik Picheta
b2fd562983 Updates docs and news. 2014-04-06 20:46:31 +01:00
Dominik Picheta
cd70bba332 Added asynchttpserver module. 2014-04-05 20:30:32 +01:00