Add some more notes.

This commit is contained in:
Sönke Ludwig 2017-07-18 23:12:26 +02:00
parent bce39e512c
commit 82936041e4

View file

@ -11,10 +11,13 @@ module vibe.core.channel;
// TODO: implement a multi-channel wait, e.g. // TODO: implement a multi-channel wait, e.g.
// TaggedAlgebraic!(...) consumeAny(ch1, ch2, ch3); - requires a waitOnMultipleConditions function // TaggedAlgebraic!(...) consumeAny(ch1, ch2, ch3); - requires a waitOnMultipleConditions function
// TODO: implement close() // TODO: implement close()
// TODO: fully support non-copyable types using swap/move where appropriate
// TODO: add unit tests
// Q: Should this be exposed as a class, or as an RC struct?
private final class Channel(T, size_t buffer_size = 100) { private final class Channel(T, size_t buffer_size = 100) {
import vibe.core.concurrency : isWeaklyIsolated; import vibe.core.concurrency : isWeaklyIsolated;
//static assert(isWeaklyIsolated!T, "Channel data type "~T.stringof~" is not safe to pass between threads."); static assert(isWeaklyIsolated!T, "Channel data type "~T.stringof~" is not safe to pass between threads.");
Mutex m_mutex; Mutex m_mutex;
TaskCondition m_condition; TaskCondition m_condition;