Commit graph

304 commits

Author SHA1 Message Date
Sönke Ludwig eb0697d6e4 Let types that implicitly convert to interface pass interface check.
"null" in particular is now considered to pass the interface conformance check.
2016-11-05 01:42:20 +01:00
Sönke Ludwig 9cfb702f0b Fix deprecation warnings. 2016-11-05 01:41:15 +01:00
Sönke Ludwig a8cd1be065 More safe-ty. 2016-11-05 01:06:11 +01:00
Sönke Ludwig 9df6874a55 Annotate FreeListRef safe as far as possible. 2016-11-05 00:58:51 +01:00
Sönke Ludwig 3a5975f046 Add appmain for backwards compatibility. 2016-11-04 21:34:01 +01:00
Sönke Ludwig 0c3c31b969 Annotate more of Task/TaskLocal as safe. 2016-11-04 21:33:01 +01:00
Sönke Ludwig d5e19e1db6 Disable failing unit tests until Path is properly implemented. 2016-11-02 21:02:36 +01:00
Sönke Ludwig 5e89ac4e91 Safe-ify sync module. 2016-11-02 21:01:09 +01:00
Sönke Ludwig c7e1468c87 Extend the Path interface (not yet fully implemented). 2016-11-02 21:00:13 +01:00
Sönke Ludwig 1fad8f5c9d Improve stream module documentation and avoid default arguments. 2016-11-02 20:59:55 +01:00
Sönke Ludwig b96c20ef54 Fix interface conformance checks.
- Now includes final interface methods
- Properly checks attributes
2016-11-02 20:59:19 +01:00
Sönke Ludwig 2d37e550bd Safe-ify net module, and extend functionality.
- Custom bind address for outgoing stream connections
- reusePort flag
- Full OutputStream interface for TCPConnection.
2016-11-02 20:58:00 +01:00
Sönke Ludwig 831ef743f2 Safe-ify the file module. 2016-11-02 20:54:43 +01:00
Sönke Ludwig 616130cef1 Safe-ify internal code. 2016-11-02 20:53:30 +01:00
Sönke Ludwig 6094971947 Fix unit test. 2016-11-02 20:52:59 +01:00
Sönke Ludwig 2071f30a1c Remove public HTML escaping declarations from log module. 2016-11-02 20:24:41 +01:00
Sönke Ludwig d06ad74ee3 Fix and safe-ify ConnectionPool. 2016-11-02 20:23:57 +01:00
Sönke Ludwig 0ee42c4243 Add vibe.d 0.7.x compatible stream definitions.
In contrast to 0.7.x, streams can now be either of class, struct or interface type.
2016-10-26 13:11:28 +02:00
Sönke Ludwig 568ccb7127 Implement DirectoryWatcher. 2016-10-25 08:57:16 +02:00
Sönke Ludwig 12daa5c575 Add Path concatenation operators. 2016-10-25 08:56:05 +02:00
Sönke Ludwig 1eb06c4b1a Mark ManualEvent's interface as safe. 2016-10-25 08:55:48 +02:00
Sönke Ludwig 4db9b3f100 Implement DNS lookups and partially implement UDP. 2016-10-25 00:27:51 +02:00
Sönke Ludwig c08f101549 Update for eventcore 0.5.0 and the latest DMD beta. 2016-10-24 08:22:49 +02:00
Sönke Ludwig 5bbf07beb8 Fix FileStream.close and let the file test clean up after itself. 2016-10-06 22:15:25 +02:00
Sönke Ludwig cf75d968d5 Base FileStream on eventcore. 2016-10-06 22:06:51 +02:00
Sönke Ludwig 1337715b2d Remove unused code. 2016-10-06 22:05:07 +02:00
Sönke Ludwig e294d24a4b Update for latest eventcore version. 2016-10-05 14:40:29 +02:00
Sönke Ludwig 914e9ad894 Change debug version "VibeMutexPrint" -> "VibeMutexLog". 2016-10-04 17:53:40 +02:00
Sönke Ludwig 6a1f2ddee3 Make std.concurrency parallelism primitive configurable.
Backport from mainline vibe.d.
2016-10-04 17:53:20 +02:00
Sönke Ludwig 930ba5c3de Fix safety annotation issues. 2016-10-04 17:51:49 +02:00
Sönke Ludwig 1c2850f99f Make all low-level asnyc log messages opt-in. 2016-10-04 17:51:24 +02:00
Sönke Ludwig ff8882976d Fix BatchBuffer.read. 2016-10-04 17:50:13 +02:00
Sönke Ludwig 19f796af9f Add vibe.core.runApplication. See rejectedsoftware/vibe.d#1417. 2016-08-30 12:30:49 +02:00
Sönke Ludwig 4c6f26bd00 Add a minimalistic duck typing based stream representation. 2016-06-18 10:00:02 +02:00
Sönke Ludwig 6bf63c7331 Add optional terminal color support and make the task/thread prefix more concise. 2016-06-17 22:34:50 +02:00
Sönke Ludwig 1005f5c674 Fix all ManualEvent related tests. 2016-06-17 22:33:04 +02:00
Sönke Ludwig f9579a5dd2 Various task scheduling fixes.
- the initial task yield() now is done in an uninterruptible way
- switchToTask now handles switching to an already scheduled task gracefully
- TaskScheduler.hibernate() now properly blocks when called form outside of a task
- added yieldUninterruptible()
2016-06-16 10:58:12 +02:00
Sönke Ludwig ed36531bd2 Add runEventLoopOnce() and fix hibernate() to block outside of a task. 2016-06-16 10:44:55 +02:00
Sönke Ludwig e8ba981263 Draft proper shared semantics for ManualEvent. 2016-06-15 18:21:33 +02:00
Sönke Ludwig a74a89cab7 Fix scope issues in asyncAwait. 2016-06-15 18:21:04 +02:00
Sönke Ludwig 48131ce7b8 Implement generic asyncAwaitAny.
This enables waiting for multiple events at the same time. Generic timeout functionality is now also implemented.
2016-06-14 09:26:12 +02:00
Sönke Ludwig 8264070f19 Fix for latest eventcore changes. 2016-06-14 09:25:28 +02:00
Sönke Ludwig 3b0e4e0452 Big refactoring step.
- Moves a lot of stuff from vibe.core.core to vibe.core.task
- Introduces TaskScheduler to unify the scheduling process
- Refines how tasks are scheduled and processed (can push to the front of the task queue and uses a marker task to keep track of the spot up to which to process)
- Start to add proper support for task interrupts and timeouts by properly cancelling in-flight async operations
- Work on ManualEvent - still not functional for the shared case
- Implement proper IP address parsing in NetworkAddress
2016-06-14 08:01:03 +02:00
Sönke Ludwig c3857d1bc9 Fix compile errors. 2016-04-10 17:17:30 +02:00
Sönke Ludwig ba48a6f43a Use BatchBuffer instead of FixedRingBuffer for TCP read. 2016-04-10 17:17:15 +02:00
Sönke Ludwig 77dc93baa7 Add a function to disable vibe.d's default signal handlers. Fixes #1333.
(cherry picked from commit 29fab2e10bb864a8aee694d4a9de8f26fab2363e)
2016-04-10 14:40:40 +02:00
Sönke Ludwig 508669b781 Fix compile error when calling async() an unshared delegate.
(cherry picked from commit a8faddf64170e5d1347b67e1d48b7796bbe08fd9)
2016-04-10 14:40:40 +02:00
Sönke Ludwig 21619e8a30 Add allocation-less overloads of NetworkAddress.to(Address)String.
(cherry picked from commit 997d78ad36bfee853daefe663e3a54314a652b19)
2016-04-10 14:40:39 +02:00
Sönke Ludwig 76626f2fd4 Add support for FreeBSD and NetBSD
(cherry picked from commit 546fe60d327886265d3d14b447123010621013f6)
2016-04-10 14:40:39 +02:00
Sönke Ludwig 8f4222916f Weaken the task double-resumption assertion condition.
This assertion got triggered in a number of harmless situations and it's not always easy to avoid. Trying to avoid it, it has already caused a rather bad task starvation bug (#1441), so at this point it seems to be better to get rid of it.

See also #1407

(cherry picked from commit 621e34b388848c762a7525149ea449ad082996a1)
2016-04-10 14:40:39 +02:00
Sönke Ludwig 27e0019e44 Fix regression in FreeListRef where no memory was allocated for the ref count. Fixes #1432.
Commit 6be5471 switched FreeListRef to use FreeListObjectAlloc underneath, but didn't accound for the extra memory that is needed to store the reference count directly after the object payload. The possible implications of this are memory corruption and memory leaks, although with the predefined allocator setip, this will only happen to types with a POT size or slightly less.

This commit adds an "EXTRA" template type parameter to FreeListObjectAlloc that is used to determine the additional amount of allocated memory, which is set to "int" in the case of FreeListRef.

(cherry picked from commit d78a9ce89b845e4f89a84bd70bbd48c7595463d4)

(cherry picked from commit 613d15926e241c03e75bb2d237d39ba712613aeb)
2016-04-10 14:40:39 +02:00
Sönke Ludwig 3a6583b375 Explictly avoid double-resumption of tasks during Libevent2TCPConnection.close().
The previous fix for #1376 resulted in a possible task starvation when the peer reset the connection before the outbound buffer was drained. The new approach now always resumes the waiting task exactly once, no matter how many events happen and no matter in which order.

(cherry picked from commit 350130a2b05cfbf12764ffaa6a86403eacf172d9)
2016-04-10 14:40:38 +02:00
Martin Nowak dc9002de0e make splitting of log lines configurable
- it might make sense to have newlines in a log message
  (e.g. when printing a backtrace) and they shouldn't
  be split into multiple log messages, e.g. when using syslog
- the splitting was fixed to work with more than one LF

(cherry picked from commit d14ce3dea1b98227dcd116acc6b175c56d9a1fb0)
2016-04-10 14:40:38 +02:00
Sönke Ludwig 7e2d1dd038 Initial commit.
The library is able to support simple TCP servers in the current state. The API is still mostly compatible with mainline vibe.d, but the driver systen has been replaced by the eventcore library and sockets/files/timers/... are now structs with automatic reference counting instead of GC collected classes. The stream interfaces have been removed for now.
2016-03-01 20:30:42 +01:00