Type Alias roles_logic_sv2::handlers::template_distribution::SendTo

source ·
pub type SendTo = SendTo_<TemplateDistribution<'static>, ()>;

Aliased Type§

enum SendTo {
    RelayNewMessageToRemote(Arc<Mutex<()>>, TemplateDistribution<'static>),
    RelaySameMessageToRemote(Arc<Mutex<()>>),
    RelayNewMessage(TemplateDistribution<'static>),
    Respond(TemplateDistribution<'static>),
    Multiple(Vec<SendTo_<TemplateDistribution<'static>, ()>>),
    None(Option<TemplateDistribution<'static>>),
}

Variants§

§

RelayNewMessageToRemote(Arc<Mutex<()>>, TemplateDistribution<'static>)

Used by proxies when Message must be relayed downstream or upstream and we want to specify to which particular downstream or upstream we want to relay the message.

When the message that we need to relay is the same message that we received should be used RelaySameMessageToRemote in order to save an allocation.

§

RelaySameMessageToRemote(Arc<Mutex<()>>)

Used by proxies when Message must be relayed downstream or upstream and we want to specify to which particular downstream or upstream we want to relay the message.

Is used when we need to relay the same message the we received in order to save an allocation.

§

RelayNewMessage(TemplateDistribution<'static>)

Used by proxies when Message must be relayed downstream or upstream and we do not want to specify specify to which particular downstream or upstream we want to relay the message.

This is used in proxies that do and Sv1 to Sv2 translation. The upstream is connected via an extended channel that means that

§

Respond(TemplateDistribution<'static>)

Used proxies clients and servers to directly respond to a received message.

§

Multiple(Vec<SendTo_<TemplateDistribution<'static>, ()>>)

§

None(Option<TemplateDistribution<'static>>)

Used by proxies, clients, and servers, when Message do not have to be used in any of the above way. If Message is still needed to be used in a non conventional way we use SendTo::None(Some(message)) If we just want to discard it we can use SendTo::None(None)

SendTo::None(Some(m)) could be used for example when we do not need to send the message, but we still need it for successive handling/transformation. One of these cases are proxies that are connected to upstream via an extended channel (like the Sv1 <-> Sv2 translator). This because extended channel messages are always general for all the downstream, where standard channel message can be specific for a particular downstream. Another case is when 2 roles are implemented in the same software, like a pool that is both TP client and a Mining server, messages received by the TP client must be sent to the Mining Server than transformed in Mining messages and sent to the downstream.