Skip to content

Commit

Permalink
remove internal/ctxwatch package
Browse files Browse the repository at this point in the history
  • Loading branch information
b97tsk committed Sep 3, 2023
1 parent bfebcb9 commit 6f50185
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 257 deletions.
3 changes: 1 addition & 2 deletions empty.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package rx
import (
"context"

"github.com/b97tsk/rx/internal/ctxwatch"
"github.com/b97tsk/rx/internal/waitgroup"
)

Expand All @@ -30,7 +29,7 @@ func never[T any](ctx context.Context, sink Observer[T]) {
wg.Add(1)
}

ctxwatch.Add(ctx, func() {
context.AfterFunc(ctx, func() {
if wg != nil {
defer wg.Done()
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/b97tsk/rx

go 1.19
go 1.21.0

require golang.org/x/exp v0.0.0-20220428152302-39d4317da171

Expand Down
198 changes: 0 additions & 198 deletions internal/ctxwatch/ctxwatch.go

This file was deleted.

50 changes: 0 additions & 50 deletions internal/ctxwatch/ctxwatch_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions multicast.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"runtime"
"sync"

"github.com/b97tsk/rx/internal/ctxwatch"
"github.com/b97tsk/rx/internal/waitgroup"
)

Expand Down Expand Up @@ -102,7 +101,7 @@ func (m *multicast[T]) subscribe(ctx context.Context, sink Observer[T]) {
wg.Add(1)
}

ctxwatch.Add(ctx, func() {
context.AfterFunc(ctx, func() {
if wg != nil {
defer wg.Done()
}
Expand Down
3 changes: 1 addition & 2 deletions multicastreplay.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"sync/atomic"
"time"

"github.com/b97tsk/rx/internal/ctxwatch"
"github.com/b97tsk/rx/internal/queue"
"github.com/b97tsk/rx/internal/waitgroup"
)
Expand Down Expand Up @@ -180,7 +179,7 @@ func (m *multicastReplay[T]) subscribe(ctx context.Context, sink Observer[T]) {
wg.Add(1)
}

ctxwatch.Add(ctx, func() {
context.AfterFunc(ctx, func() {
if wg != nil {
defer wg.Done()
}
Expand Down
3 changes: 1 addition & 2 deletions share.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"sync"

"github.com/b97tsk/rx/internal/ctxwatch"
"github.com/b97tsk/rx/internal/waitgroup"
)

Expand Down Expand Up @@ -137,7 +136,7 @@ func (obs *shareObservable[T]) Subscribe(ctx context.Context, sink Observer[T])
wg.Add(1)
}

ctxwatch.Add(ctx, func() {
context.AfterFunc(ctx, func() {
if wg != nil {
defer wg.Done()
}
Expand Down

0 comments on commit 6f50185

Please sign in to comment.