Turi Create  4.0
turi::neural_net::Publisher< T > Class Template Referenceabstract

#include <ml/neural_net/combine_base.hpp>

Public Types

using Output = T
 

Public Member Functions

virtual void Receive (std::shared_ptr< Subscriber< Output >> subscriber)=0
 

Detailed Description

template<typename T>
class turi::neural_net::Publisher< T >

Interface for objects that produce values on demand from its Subscribers.

Unless otherwise specified by the concrete implementation, external synchronization must be used to avoid concurrent calls on multiple threads to a Publisher, including via the Subscriptions that it passes to its Subscribers.

Each concrete implementation defines whether it is unicast or multicast: whether multiple Subscribers observe the same values or not. (An implementation might only support one Subscriber, by passing an immediate Completion to each Subscriber after the first.)

Note: instances of this class are intended to be stored using shared_ptr. Many of the operators rely on generating strong references to the instance being augmented.

Definition at line 214 of file combine_base.hpp.

Member Typedef Documentation

◆ Output

template<typename T>
using turi::neural_net::Publisher< T >::Output = T

The type of values that this Publisher produces.

Definition at line 217 of file combine_base.hpp.

Member Function Documentation

◆ Receive()

template<typename T>
virtual void turi::neural_net::Publisher< T >::Receive ( std::shared_ptr< Subscriber< Output >>  subscriber)
pure virtual

Establishes a connection between this Publisher and the given Subcriber.

The Publisher must eventually call Subscriber::Receive(Subscription) on the given Subscriber (and may do so synchronously). The Publisher must then conform to the protocol established by the Subscription.

Implemented in turi::neural_net::ReceiveOnQueuePublisher< T >, turi::neural_net::IteratorPublisher< T >, turi::neural_net::MapPublisher< T, U >, and turi::neural_net::SubscribeOnQueuePublisher< T >.


The documentation for this class was generated from the following file: