2017-03-18 19 views

回答

0

我瞭解到,你可以做什麼,我跟Flux.generate想輕鬆:

Flux.generate(
    () -> initialState, 
    (state, sink) -> { 
     Pair<State, Value> p = f.apply(state); // get the new state and the value 
     sink.next(p.right); // this is basically calling the subscriber with the value 
     return p.left; // this returns the new state 
    } 
); 
相關問題