Skip to content

Commit

Permalink
Export RemoveSub
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanTinianov committed Jan 10, 2025
1 parent a012866 commit 25fe8d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions multinode/adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (m *Adapter[RPC, HEAD]) RegisterSub(sub *ManagedSubscription, stopInFLightC
return nil
}

func (m *Adapter[RPC, HEAD]) removeSub(sub Subscription) {
func (m *Adapter[RPC, HEAD]) RemoveSub(sub Subscription) {
m.subsSliceMu.Lock()
defer m.subsSliceMu.Unlock()
delete(m.subs, sub)
Expand Down Expand Up @@ -143,7 +143,7 @@ func (m *Adapter[RPC, HEAD]) SubscribeToHeads(ctx context.Context) (<-chan HEAD,

sub := &ManagedSubscription{
Subscription: &poller,
onUnsubscribe: m.removeSub,
onUnsubscribe: m.RemoveSub,
}

err := m.RegisterSub(sub, chStopInFlight)
Expand Down Expand Up @@ -176,7 +176,7 @@ func (m *Adapter[RPC, HEAD]) SubscribeToFinalizedHeads(ctx context.Context) (<-c

sub := &ManagedSubscription{
Subscription: &poller,
onUnsubscribe: m.removeSub,
onUnsubscribe: m.RemoveSub,
}

err := m.RegisterSub(sub, chStopInFlight)
Expand Down
8 changes: 4 additions & 4 deletions multinode/adaptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestMultiNodeClient_RegisterSubs(t *testing.T) {
mockSub := newMockSub()
sub := &ManagedSubscription{
Subscription: mockSub,
onUnsubscribe: c.removeSub,
onUnsubscribe: c.RemoveSub,
}
err := c.RegisterSub(sub, make(chan struct{}))
require.NoError(t, err)
Expand All @@ -151,7 +151,7 @@ func TestMultiNodeClient_RegisterSubs(t *testing.T) {
mockSub := newMockSub()
sub := &ManagedSubscription{
Subscription: mockSub,
onUnsubscribe: c.removeSub,
onUnsubscribe: c.RemoveSub,
}
err := c.RegisterSub(sub, chStopInFlight)
require.Error(t, err)
Expand All @@ -164,12 +164,12 @@ func TestMultiNodeClient_RegisterSubs(t *testing.T) {
mockSub1 := newMockSub()
sub1 := &ManagedSubscription{
Subscription: mockSub1,
onUnsubscribe: c.removeSub,
onUnsubscribe: c.RemoveSub,
}
mockSub2 := newMockSub()
sub2 := &ManagedSubscription{
Subscription: mockSub2,
onUnsubscribe: c.removeSub,
onUnsubscribe: c.RemoveSub,
}
err := c.RegisterSub(sub1, chStopInFlight)
require.NoError(t, err)
Expand Down

0 comments on commit 25fe8d0

Please sign in to comment.