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

#include <ml/neural_net/combine_base.hpp>

Public Types

using Input = T
 

Public Member Functions

virtual void Receive (std::shared_ptr< Subscription > subscription)=0
 
virtual Demand Receive (Input element)=0
 
virtual void Receive (Completion completion)=0
 

Detailed Description

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

Interface for objects that consume values from a Publisher.

Unless otherwise specified by the concrete implementation, external synchronization must be used to avoid concurrent calls the Subscriber interface from different threads.

Definition at line 158 of file combine_base.hpp.

Member Typedef Documentation

◆ Input

template<typename T>
using turi::neural_net::Subscriber< T >::Input = T

The type of the values that this Subscriber consumes.

Definition at line 161 of file combine_base.hpp.

Member Function Documentation

◆ Receive() [1/3]

template<typename T>
virtual void turi::neural_net::Subscriber< T >::Receive ( std::shared_ptr< Subscription subscription)
pure virtual

The first signal that a Subscriber receives from a Publisher, passing the Subscription that the Subscriber can use to control the flow of values.

A Subscriber may only have one Publisher. If it somehow receives more than one Subscription, it should call Subscription::Cancel() on any instances received after the first.

A Subscriber is explictly allowed to demand values synchronously from within its implementation of this method.

Implemented in turi::neural_net::FuturesSubscriber< T >.

◆ Receive() [2/3]

template<typename T>
virtual Demand turi::neural_net::Subscriber< T >::Receive ( Input  element)
pure virtual

Transmits a value from the Publisher to this Subscriber.

A Subcriber should never receive more calls to this method than the total Demand it has requested from its publisher. Subscribers should only demand more elements from within this method via its return value.

Implemented in turi::neural_net::FuturesSubscriber< T >.

◆ Receive() [3/3]

template<typename T>
virtual void turi::neural_net::Subscriber< T >::Receive ( Completion  completion)
pure virtual

Signals completion of the stream of values from the Publisher.

A Subscriber should not receive any further signals of any kind after receiving a Completion.

Implemented in turi::neural_net::FuturesSubscriber< T >.


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