Class BaseFlux<T>
- java.lang.Object
-
- tech.cassandre.trading.bot.util.base.Base
-
- tech.cassandre.trading.bot.util.base.batch.BaseFlux<T>
-
- Type Parameters:
T
- flux
- Direct Known Subclasses:
AccountFlux
,OrderFlux
,PositionFlux
,TickerFlux
,TradeFlux
public abstract class BaseFlux<T> extends Base
Base flux.
-
-
Field Summary
Fields Modifier and Type Field Description protected reactor.core.publisher.Flux<Set<T>>
flux
Flux.protected reactor.core.publisher.FluxSink<Set<T>>
fluxSink
Flux sink.-
Fields inherited from class tech.cassandre.trading.bot.util.base.Base
accountMapper, currencyMapper, logger, orderMapper, positionMapper, strategyMapper, tickerMapper, tradeMapper, utilMapper
-
-
Constructor Summary
Constructors Constructor Description BaseFlux()
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
emitValue(T newValue)
Emit new value.void
emitValues(Set<T> newValues)
Emit new values.reactor.core.publisher.Flux<Set<T>>
getFlux()
Getter for flux.protected abstract Set<T>
getNewValues()
Implements this method to return all the new values.protected reactor.core.publisher.FluxSink.OverflowStrategy
getOverflowStrategy()
Set the default overflow strategy - override to change it.protected abstract Set<T>
saveValues(Set<T> newValue)
Implements this method to save values coming from flux.void
update()
Method executed when values have to be retrieved (usually called by schedulers).
-
-
-
Method Detail
-
getOverflowStrategy
protected reactor.core.publisher.FluxSink.OverflowStrategy getOverflowStrategy()
Set the default overflow strategy - override to change it.- Returns:
- overflow strategy
-
emitValue
public void emitValue(T newValue)
Emit new value.- Parameters:
newValue
- new value
-
emitValues
public void emitValues(Set<T> newValues)
Emit new values.- Parameters:
newValues
- new values
-
update
public final void update()
Method executed when values have to be retrieved (usually called by schedulers).
-
getNewValues
protected abstract Set<T> getNewValues()
Implements this method to return all the new values. Those values will be sent to the strategy.- Returns:
- list of new values
-
-