fluid.future.pipe

Mechanism for asynchronously passing data from one place to another.

Members

Aliases

AllPublishers
alias AllPublishers(T) = Filter!(isPublisher, InterfacesTuple!T, Filter!(isInterface, T))

List all publishers implemented by the given type (including, if the given type is a publisher).

AllSubscribers
alias AllSubscribers(T) = Filter!(isSubscriber, InterfacesTuple!T, Filter!(isInterface, T))

List all subscribers implemented by the given type (including, if the given type is a publisher).

MultiPublisher
alias MultiPublisher(IPipes...) = MultiPublisherImpl!(staticMap!(AllPublishers, IPipes))

A basic publisher (and subscriber) implementation that will pipe data to subscribers of the matching type.

Publisher
alias Publisher(Output : void) = Publisher!()

A publisher sends emits events that other objects can listen to.

Classes

AssertPipe
class AssertPipe(Ts...)
Undocumented in source.
JoinPublisher
class JoinPublisher

Listens to a number of publishers, and as soon as all of them emit a result at least once, emits an event.

MultiPublisherImpl
class MultiPublisherImpl(IPipes...)
Undocumented in source.
Pipe
class Pipe(Return, Args...)

Pipes provide a callback system where functions can be chained. The result of one callback can be passed to another in a linear chain.

Enums

isPublisher
eponymoustemplate isPublisher(T)

Check if the given type is a publisher.

isSubscriber
eponymoustemplate isSubscriber(T)

Check if the given type is a subscriber.

Functions

join
JoinPublisher join(Publisher!()[] publishers)

Combine multiple publishers to create one that waits until all of them are completed.

pipe
auto pipe(Ret delegate(Args) @(safe) dg)

Set up a pipe from a delegate.

thenAssertEquals
AssertPipe!(PipeContent!(PublisherType!(T, Inputs)[0])) thenAssertEquals(T publisher, Inputs value, string file, size_t lineNumber)

Connect to a publisher and assert the values it sends equal the one attached.

Interfaces

Publisher
interface Publisher(Outputs...)

A publisher sends emits events that other objects can listen to.

Subscriber
interface Subscriber(Ts...)

A subscriber is an object that receives data from a Publisher.

Structs

Event
struct Event(T...)
Undocumented in source.

Templates

PipeContent
template PipeContent(T)

For an instance of either Publisher or Subscriber, get the type trasmitted by the interface. This function only operates on the two interfaces directly, and will not work with subclasses.

PublisherType
template PublisherType(Publisher, Inputs...)

Get the Publisher interfaces that can output a value that shares a common type with Inputs.

ToParameter
template ToParameter(T)

Converts void to () (an empty tuple), leaves remaining types unchanged.

Meta