Commit graph

37 commits

Author SHA1 Message Date
Dominik Picheta
b3469c43a6 Implemented 'await connect' fully. Fixed a buffering and 'reqReg' bug.
* reqReq did not reset lastReq to reqNil, this caused problems in the
new tasyncitermacro test. (await accept stopped accepting requests after
some arbitrary amount have been accepted).
* Rewritten and moved tasyncitermacro to tests/run/ so that the tester
actually tests whether it works at runtime.
* tasynciterraw is now a copy of tasyncitermacro after macro expansion.
It will be used as a control test, useful if the macro starts generating
incorrect code.
2013-08-03 14:19:17 +01:00
Dominik Picheta
e42f877664 Optimised `await` on custom async procs.
* The async proc is now invoked immediately after the 'await' request
is processed. This means that the iterator is executed until it yields
with a request which cannot be immediately satisfied (e.g. readLine)
after which point a
select() call will need to be made. Previously the async proc would only
be added to the list of requests, the event loop would need to start
over and thus would need to go
through each request again before invoking the iterator and reaching a
request which could not be immediately satisfied.
* This was implemented by recursively calling the processWorker
procedure in asyncio.nim. In the future it may be of benefit to also
perform this for reqReg.
* When the awaited user-defined async proc finishes, the parent worker
will be executed, the same optimisation has been used for that case.
* The way that this optimisation is implemented means that even multiple
levels of awaited user-defined procs will be quickly processed. (Look at
the tasyncitermacro test, the auth procs are arranged this way to test
this)
2013-07-31 23:27:07 +01:00
Dominik Picheta
70d67daa14 Introduced 'reg' keyword, and changed the await behaviour for custom
procs.
2013-07-31 19:28:37 +01:00
Dominik Picheta
ae64089e53 Fixed crash when worker has just been registered and didn't get executed
yet.
2013-07-28 18:28:50 +01:00
Dominik Picheta
426c2d6c01 Implemented default arguments for async procs. 2013-07-28 14:41:09 +01:00
Dominik Picheta
2330c95b22 Implemented genSym for async function calls. 2013-07-28 13:50:32 +01:00
Dominik Picheta
c5ff9650f7 Changed some asyncio macro code to use the new genSym. 2013-07-25 22:13:37 +01:00
Dominik Picheta
d8659eaaa2 Another docs fix for asyncio. 2013-07-21 15:18:44 +01:00
Dominik Picheta
1e1a583903 Fixes problems with async docs. 2013-07-21 14:51:25 +01:00
Dominik Picheta
a1a8925692 Calling an async proc with invalid arguments will now fail at compile-time. 2013-07-21 14:28:02 +01:00
Dominik Picheta
d15e67e020 Better param passing. Implemented send, readLine and support for
documentation stubs.
2013-07-21 13:58:54 +01:00
Dominik Picheta
75893d1b36 First implementation of the async/await-like system with macros. 2013-07-20 23:42:10 +01:00
Dominik Picheta
bacb20a379 Deprecated OSError, and modified it to require an explicit OS error code.
The deprecated functions include the OSError and OSErrorMsg, the name did not change however the signature of the new functions did. They now require a TOSErrorCode value be passed to them. This value can be retrieved using OSLastError. The reason this was done is because on Windows any win api call can reset the last error code to 0, this change allows the user to immediately grab the error code and worry about the string representation later if needs be.
2013-06-25 20:10:28 +01:00
Dominik Picheta
a1e823b038 Added an asyncio.isSendDataBuffered procedure. 2013-06-21 16:07:13 +02:00
Dominik Picheta
0b2512e1e4 Improved the performance of the SCGI module when dealing with multiple
concurrent requests.
2013-05-19 18:33:47 +01:00
Dominik Picheta
e3d097c4e9 Fixed recvLine deprecation warnings. 2013-04-14 01:00:38 +01:00
Dominik Picheta
5267984985 Deprecated recvLine and added an improved version named readLine to the
sockets module.
2013-03-23 20:13:11 +00:00
Dominik Picheta
da609fc445 Fixed many deprecation warnings. asyncio.recvLine now throws an
exception when an error occurs. Added sockets.SocketError.
2012-12-23 14:05:16 +00:00
Dominik Picheta
d6632ad973 Fixes #268 2012-12-08 19:04:45 +00:00
Dominik Picheta
336da8f44e IRC module is now saner at the expense of a little API breakage.
Added warnings for unstable APIs to modules that use AsyncIO.
2012-12-01 16:04:59 +00:00
Dominik Picheta
76c4b0516a Many doc improvements. Changed Threads.joinThreads' param's type to varargs. 2012-11-04 22:30:19 +00:00
Dominik Picheta
6c6f9e6674 Ftpclient now fully works both synchronously and asynchronously.
Fixed some deprecation doc messages. And some issues with asyncio.
2012-09-22 16:39:51 +01:00
Dominik Picheta
be1a709e7e ftpclient fixed but causes an issue with the code generator and
therefore does not compile.

Asyncio: Added handleWrite event and an ability to wrap an already
initialised TSocket to a PAsyncSocket.
Fixed tircbot test.
2012-09-21 20:39:47 +01:00
Dominik Picheta
254bc714dd Fixes IRC module. 2012-09-12 23:50:23 +01:00
Dominik Picheta
7c262b4233 Fixes scgi, adds async functionality to httpserver. 2012-09-09 22:21:23 +01:00
Araq
b64eeeb430 term rewriting improvements 2012-09-08 15:43:21 +02:00
Dominik Picheta
223b4f45ed Added fsmonitor module. 2012-09-02 23:26:49 +01:00
Dominik Picheta
d127ad5076 Asyncio module now works on file descriptors. 2012-09-02 19:58:13 +01:00
Dominik Picheta
8dd1a5a181 Sockets module should compile again on Windows. Fixed asyncio not compiling. 2012-08-12 20:25:30 +01:00
Dominik Picheta
e9604b4433 UDP improvements for the sockets module. Renamed ftpclient.fileExists to
existsFile for consistency. Added tasyncudp test.
2012-08-12 11:53:09 +01:00
Dominik Picheta
9c8b76dbd2 UDP sockets should now work with asyncio. 2012-08-03 00:26:40 +01:00
Dominik Picheta
3ffff9ec43 More deprecation warnings fixed. 2012-07-23 21:29:10 +01:00
Dominik Picheta
1be06ee2de Fixes deprecation warning, fixes documentation error. 2012-07-23 20:56:39 +01:00
Dominik Picheta
5310a3044f Many fixes for asynchronous sockets. Asyncio should now work well with buffered and unbuffered plain and ssl sockets. Added asyncio
test to the test suite.
2012-07-22 23:32:49 +01:00
Araq
8d99753d63 preparations for making 'closure' the default calling convention for proc types 2012-07-16 23:00:57 +02:00
dom96
9aeecaa4cf recvLineAsync for non-blocking sockets implemented, as well as recvLine for asyncio async sockets. Fixed removeDir on windows. 2012-02-18 00:34:44 +00:00
dom96
b298b07567 Added asyncio module; irc, scgi and the ftpclient modules work with it. Added (de)allocCStringArray. Many async sockets fixes. 2012-01-22 16:21:05 +00:00