@@ -36,13 +36,13 @@ type roflHostHandler struct {
3636 comp * bundle.ExplodedComponent
3737 comps map [component.ID ]host.Runtime
3838
39- client runtimeClient.RuntimeClient
40- eventNotifier * roflEventNotifier
39+ client runtimeClient.RuntimeClient
40+ roflNotifier * ROFLNotifier
4141
4242 logger * logging.Logger
4343}
4444
45- func newSubHandlerROFL (comp * bundle.ExplodedComponent , parent * runtimeHostHandler ) (* roflHostHandler , error ) {
45+ func newSubHandlerROFL (comp * bundle.ExplodedComponent , parent * runtimeHostHandler , roflNotifier * ROFLNotifier ) (* roflHostHandler , error ) {
4646 client , err := parent .env .GetRuntimeRegistry ().Client ()
4747 if err != nil {
4848 return nil , err
@@ -53,13 +53,13 @@ func newSubHandlerROFL(comp *bundle.ExplodedComponent, parent *runtimeHostHandle
5353 With ("component_id" , comp .ID ())
5454
5555 return & roflHostHandler {
56- parent : parent ,
57- id : comp .ID (),
58- comp : comp ,
59- comps : make (map [component.ID ]host.Runtime ),
60- client : client ,
61- eventNotifier : newROFLEventNotifier ( parent . runtime , client , logger ) ,
62- logger : logger ,
56+ parent : parent ,
57+ id : comp .ID (),
58+ comp : comp ,
59+ comps : make (map [component.ID ]host.Runtime ),
60+ client : client ,
61+ roflNotifier : roflNotifier ,
62+ logger : logger ,
6363 }, nil
6464}
6565
@@ -74,7 +74,7 @@ func (rh *roflHostHandler) AttachRuntime(id component.ID, rt host.Runtime) error
7474 if id != rh .id {
7575 return nil
7676 }
77- return rh . eventNotifier . AttachRuntime ( rt )
77+ return nil
7878}
7979
8080// getLocalStorageKey returns a properly namespaced version of the local storage key.
@@ -254,13 +254,15 @@ func (rh *roflHostHandler) handleHostSubmitTx(
254254}
255255
256256func (rh * roflHostHandler ) handleHostRegisterNotify (
257- ctx context.Context ,
257+ _ context.Context ,
258258 rq * protocol.HostRegisterNotifyRequest ,
259259) (* protocol.Empty , error ) {
260260 // Subscribe to event notifications.
261- if err := rh .eventNotifier .RegisterNotify (ctx , rq ); err != nil {
262- return nil , err
261+ nfs := & rofl.Notifications {
262+ Blocks : rq .RuntimeBlock ,
263+ Events : rq .RuntimeEvent .Tags ,
263264 }
265+ rh .roflNotifier .register (rh .id , nfs )
264266
265267 return & protocol.Empty {}, nil
266268}
0 commit comments