Skip to content

Commit

Permalink
Documentation update
Browse files Browse the repository at this point in the history
Stop / Continue naming change
  • Loading branch information
teivah committed Feb 24, 2020
1 parent 6c97d60 commit 24db51b
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 54 deletions.
4 changes: 2 additions & 2 deletions doc/all.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ true

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/average.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/contains.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ true

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)

### WithObservationStrategy

Expand Down
4 changes: 2 additions & 2 deletions doc/debounce.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Output: each item emitted by the Observable if not item has been emitted after 2

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/distinct.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/flatmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
5 changes: 3 additions & 2 deletions doc/map.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Map Operator

## Overview
Expand Down Expand Up @@ -43,8 +44,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/marshal.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/max.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/min.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ rxgo.WithObservation(rxgo.Eager)
* Stop (default): stop processing if the Observable produces an error.

```go
rxgo.WithErrorStrategy(rxgo.Stop)
rxgo.WithErrorStrategy(rxgo.StopOnError)
```

* Continue: continue processing items if the Observable produces an error.

```go
rxgo.WithErrorStrategy(rxgo.Continue)
rxgo.WithErrorStrategy(rxgo.ContinueOnError)
```

This strategy is propagated to the parent(s) Observable(s).
Expand Down
4 changes: 2 additions & 2 deletions doc/reduce.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/serialize.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ true

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/sum.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
4 changes: 2 additions & 2 deletions doc/unmarshal.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Output:

### WithPool

https://github.com/ReactiveX/RxGo/wiki/Options#withpool
[Detail](options.md#withpool)

### WithCPUPool

https://github.com/ReactiveX/RxGo/wiki/Options#withcpupool
[Detail](options.md#withcpupool)
3 changes: 1 addition & 2 deletions duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ func (d *causalityDuration) duration() time.Duration {
d.fs = d.fs[1:]
if pop.isTick {
return time.Nanosecond
} else {
return time.Minute
}
return time.Minute
}

type mockDuration struct {
Expand Down
6 changes: 3 additions & 3 deletions observable.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func runSeq(ctx context.Context, next chan Item, iterable Iterable, operatorFact
observe := iterable.Observe(opts...)
operator := operatorOptions{
stop: func() {
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
stopped = true
}
},
Expand Down Expand Up @@ -251,7 +251,7 @@ func runPar(ctx context.Context, next chan Item, iterable Iterable, operatorFact
stopped := false
operator := operatorOptions{
stop: func() {
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
stopped = true
}
},
Expand Down Expand Up @@ -281,7 +281,7 @@ func runPar(ctx context.Context, next chan Item, iterable Iterable, operatorFact
stopped := false
operator := operatorOptions{
stop: func() {
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
stopped = true
}
},
Expand Down
14 changes: 7 additions & 7 deletions observable_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ func (o *ObservableImpl) BufferWithTime(timespan Duration, opts ...Option) Obser
}
if item.Error() {
item.SendCtx(ctx, next)
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
return
}
} else {
Expand Down Expand Up @@ -515,7 +515,7 @@ func (o *ObservableImpl) BufferWithTimeOrCount(timespan Duration, count int, opt
}
if item.Error() {
item.SendCtx(ctx, next)
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
return
}
} else {
Expand Down Expand Up @@ -628,7 +628,7 @@ func (o *ObservableImpl) Debounce(timespan Duration, opts ...Option) Observable
if !item.SendCtx(ctx, next) {
return
}
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
return
}
} else {
Expand Down Expand Up @@ -1046,7 +1046,7 @@ func (o *ObservableImpl) FlatMap(apply ItemToObservable, opts ...Option) Observa
}
if item.Error() {
item.SendCtx(ctx, next)
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
return
}
} else {
Expand Down Expand Up @@ -2326,7 +2326,7 @@ func (o *ObservableImpl) TimeInterval(opts ...Option) Observable {
if !item.SendCtx(ctx, next) {
return
}
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
return
}
} else {
Expand Down Expand Up @@ -2595,7 +2595,7 @@ func (o *ObservableImpl) WindowWithTime(timespan Duration, opts ...Option) Obser
if !item.SendCtx(ctx, ch) {
return
}
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
close(ch)
return
}
Expand Down Expand Up @@ -2654,7 +2654,7 @@ func (o *ObservableImpl) WindowWithTimeOrCount(timespan Duration, count int, opt
if !item.SendCtx(ctx, ch) {
return
}
if option.getErrorStrategy() == Stop {
if option.getErrorStrategy() == StopOnError {
close(ch)
return
}
Expand Down
12 changes: 6 additions & 6 deletions observable_operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ func Test_Observable_Errors_MultipleErrorFromMap(t *testing.T) {
return nil, errBar
}
return i, nil
}, WithErrorStrategy(Continue)).Errors()
}, WithErrorStrategy(ContinueOnError)).Errors()
assert.Equal(t, 2, len(errs))
}

Expand Down Expand Up @@ -946,7 +946,7 @@ func Test_Observable_Reduce_Parallel_WithErrorStrategy(t *testing.T) {
return elem.(int), nil
}
return 0, errFoo
}, WithCPUPool(), WithErrorStrategy(Continue))
}, WithCPUPool(), WithErrorStrategy(ContinueOnError))
Assert(context.Background(), t, obs, HasItem(50015000), HasError(errFoo))
}

Expand Down Expand Up @@ -1473,7 +1473,7 @@ func Test_Observable_WindowWithTime_Eager(t *testing.T) {

func Test_Observable_WindowWithTime_ContinueOnError(t *testing.T) {
ctx, obs, d := timeCausality(1, 2, errFoo, 3, tick, 4, tick)
observe := obs.WindowWithTime(d, WithContext(ctx), WithBufferedChannel(10), WithErrorStrategy(Continue)).
observe := obs.WindowWithTime(d, WithContext(ctx), WithBufferedChannel(10), WithErrorStrategy(ContinueOnError)).
Observe()
Assert(context.Background(), t, (<-observe).V.(Observable), HasItems(1, 2, 3), HasError(errFoo))
Assert(context.Background(), t, (<-observe).V.(Observable), HasItems(4), HasNoError())
Expand Down Expand Up @@ -1508,7 +1508,7 @@ func Test_Observable_WindowWithTimeOrCount_Eager(t *testing.T) {

func Test_Observable_WindowWithTimeOrCount_ContinueOnError(t *testing.T) {
ctx, obs, d := timeCausality(1, 2, 3, tick, 4, 5, 6, 7, tick, 8, tick)
observe := obs.WindowWithTimeOrCount(d, 2, WithContext(ctx), WithErrorStrategy(Continue)).Observe()
observe := obs.WindowWithTimeOrCount(d, 2, WithContext(ctx), WithErrorStrategy(ContinueOnError)).Observe()
Assert(context.Background(), t, (<-observe).V.(Observable), HasItems(1, 2))
Assert(context.Background(), t, (<-observe).V.(Observable), HasItems(3))
Assert(context.Background(), t, (<-observe).V.(Observable), HasItems(4, 5))
Expand Down Expand Up @@ -1574,7 +1574,7 @@ func Test_Observable_Option_WithOnErrorStrategy_Single(t *testing.T) {
return nil, errFoo
}
return i, nil
}, WithErrorStrategy(Continue))
}, WithErrorStrategy(ContinueOnError))
Assert(context.Background(), t, obs, HasItems(1, 3), HasError(errFoo))
}

Expand All @@ -1591,7 +1591,7 @@ func Test_Observable_Option_WithOnErrorStrategy_Propagate(t *testing.T) {
return nil, errBar
}
return i, nil
}, WithErrorStrategy(Continue))
}, WithErrorStrategy(ContinueOnError))
Assert(context.Background(), t, obs, HasItems(3), HasErrors(errFoo, errBar))
}

Expand Down
8 changes: 4 additions & 4 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ const (
type OnErrorStrategy uint32

const (
// Stop is the default error strategy.
// StopOnError is the default error strategy.
// An operator will stop processing items on error.
Stop OnErrorStrategy = iota
// Continue means an operator will continue processing items after an error.
Continue
StopOnError OnErrorStrategy = iota
// ContinueOnError means an operator will continue processing items after an error.
ContinueOnError
)

// ObservationStrategy defines the strategy to consume from an Observable.
Expand Down

0 comments on commit 24db51b

Please sign in to comment.