diff --git a/lns.go b/lns.go index 99370f8..3606e38 100644 --- a/lns.go +++ b/lns.go @@ -37,6 +37,9 @@ type Service struct { var ( _ core.Startable = (*Service)(nil) _ core.Stoppable = (*Service)(nil) + _ interface { + HandleIPCEvents(*core.Core, core.Message) core.Result + } = (*Service)(nil) ) // serviceOptions holds configuration for the LNS service. @@ -112,6 +115,14 @@ func (s *Service) OnShutdown(context.Context) core.Result { return core.Result{OK: true} } +// HandleIPCEvents satisfies Core's IPC handler discovery. +// +// core.New(core.WithService(lns.Register)) +// // LNS registers a no-op IPC handler so it can join the bus cleanly. +func (s *Service) HandleIPCEvents(*core.Core, core.Message) core.Result { + return core.Result{OK: true} +} + func canonicalizeName(name any) (string, bool) { switch v := name.(type) { case string: diff --git a/lns_test.go b/lns_test.go index 1af2a4c..f39b5d8 100644 --- a/lns_test.go +++ b/lns_test.go @@ -26,6 +26,14 @@ func TestServiceLifecycleHooks(t *testing.T) { } } +func TestServiceHandleIPCEvents(t *testing.T) { + svc := &Service{} + + if got := svc.HandleIPCEvents(nil, nil); !got.OK { + t.Fatalf("HandleIPCEvents returned %#v, want OK", got) + } +} + func TestServiceResolve(t *testing.T) { svc := &Service{}