go-nitro icon indicating copy to clipboard operation
go-nitro copied to clipboard

Create some `unsubscribe` path for channelNotifier

Open NiloCK opened this issue 2 years ago • 0 comments

API for ChanelNotifier is

func (*ChannelNotifier).Close() error
func (*ChannelNotifier).NotifyLedgerUpdated(info query.LedgerChannelInfo) error
func (*ChannelNotifier).NotifyPaymentUpdated(info query.PaymentChannelInfo) error
func (*ChannelNotifier).RegisterForAllLedgerUpdates() <-chan query.LedgerChannelInfo
func (*ChannelNotifier).RegisterForAllPaymentUpdates() <-chan query.PaymentChannelInfo
func (*ChannelNotifier).RegisterForLedgerUpdates(cId types.Destination) <-chan query.LedgerChannelInfo
func (*ChannelNotifier).RegisterForPaymentChannelUpdates(cId types.Destination) <-chan query.PaymentChannelInfo

If a process wants to listen for a specific update, it isn't able to subscribe, get its target information and then drop the subscription. Result is a bloat of registered notification gochans.

NiloCK avatar Jun 23 '23 15:06 NiloCK