-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
655 additions
and
515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,50 @@ | ||
package flux | ||
|
||
import ( | ||
"context" | ||
"context" | ||
|
||
"github.com/jjeffcaii/reactor-go" | ||
"github.com/jjeffcaii/reactor-go/scheduler" | ||
"github.com/jjeffcaii/reactor-go" | ||
"github.com/jjeffcaii/reactor-go/scheduler" | ||
) | ||
|
||
type OverflowStrategy int8 | ||
|
||
const ( | ||
OverflowBuffer OverflowStrategy = iota | ||
OverflowIgnore | ||
OverflowError | ||
OverflowDrop | ||
OverflowLatest | ||
OverflowBuffer OverflowStrategy = iota | ||
OverflowIgnore | ||
OverflowError | ||
OverflowDrop | ||
OverflowLatest | ||
) | ||
|
||
type FnSwitchOnFirst = func(s Signal, f Flux) Flux | ||
|
||
type Flux interface { | ||
rs.Publisher | ||
Filter(rs.Predicate) Flux | ||
Map(rs.Transformer) Flux | ||
DoOnDiscard(rs.FnOnDiscard) Flux | ||
DoOnNext(rs.FnOnNext) Flux | ||
DoOnComplete(rs.FnOnComplete) Flux | ||
DoOnError(rs.FnOnError) Flux | ||
DoOnCancel(rs.FnOnCancel) Flux | ||
DoOnRequest(rs.FnOnRequest) Flux | ||
DoOnSubscribe(rs.FnOnSubscribe) Flux | ||
DoFinally(rs.FnOnFinally) Flux | ||
SwitchOnFirst(FnSwitchOnFirst) Flux | ||
SubscribeOn(scheduler.Scheduler) Flux | ||
BlockLast(context.Context) (interface{}, error) | ||
rs.Publisher | ||
Filter(rs.Predicate) Flux | ||
Map(rs.Transformer) Flux | ||
Take(n int) Flux | ||
DoOnDiscard(rs.FnOnDiscard) Flux | ||
DoOnNext(rs.FnOnNext) Flux | ||
DoOnComplete(rs.FnOnComplete) Flux | ||
DoOnError(rs.FnOnError) Flux | ||
DoOnCancel(rs.FnOnCancel) Flux | ||
DoOnRequest(rs.FnOnRequest) Flux | ||
DoOnSubscribe(rs.FnOnSubscribe) Flux | ||
DoFinally(rs.FnOnFinally) Flux | ||
SwitchOnFirst(FnSwitchOnFirst) Flux | ||
SubscribeOn(scheduler.Scheduler) Flux | ||
BlockLast(context.Context) (interface{}, error) | ||
ToChan(ctx context.Context, cap int) (c <-chan interface{}, e <-chan error) | ||
} | ||
|
||
type Sink interface { | ||
Complete() | ||
Error(error) | ||
Next(interface{}) | ||
Complete() | ||
Error(error) | ||
Next(interface{}) | ||
} | ||
|
||
type Processor interface { | ||
Flux | ||
Sink | ||
Flux | ||
Sink | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.