tdlib-session-container/src/main/java/it/tdlight/reactiveapi/ChannelProducerClientBoundE...

20 lines
602 B
Java
Raw Normal View History

2022-10-04 12:43:24 +02:00
package it.tdlight.reactiveapi;
import it.tdlight.reactiveapi.Event.ClientBoundEvent;
public class ChannelProducerClientBoundEvent {
private ChannelProducerClientBoundEvent() {
}
2022-10-05 02:26:30 +02:00
public static EventProducer<ClientBoundEvent> create(ChannelFactory channelFactory, ChannelsParameters channelsParameters, String lane) {
2022-10-04 12:43:24 +02:00
String name;
if (lane.isBlank()) {
2022-10-05 02:26:30 +02:00
name = Channel.CLIENT_BOUND_EVENT.getChannelName();
2022-10-04 12:43:24 +02:00
} else {
2022-10-05 02:26:30 +02:00
name = Channel.CLIENT_BOUND_EVENT.getChannelName() + "-" + lane;
2022-10-04 12:43:24 +02:00
}
2022-10-05 02:26:30 +02:00
return channelFactory.newProducer(channelsParameters, ChannelCodec.CLIENT_BOUND_EVENT, name);
2022-10-04 12:43:24 +02:00
}
}