X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=example%2Fexample.go;h=aee1c192422033cc2a8e9b3b8ae08db3a18b8594;hb=3d21046ffe51d54df30254881a6d2f9e3ba776ce;hp=33a91946a574906ff608d402f0603fcef36083e5;hpb=6ffe956f918e3fac2e939847268b2ae94684a738;p=ric-plt%2Fsdlgo.git diff --git a/example/example.go b/example/example.go index 33a9194..aee1c19 100644 --- a/example/example.go +++ b/example/example.go @@ -26,7 +26,6 @@ import ( "fmt" "gerrit.o-ran-sc.org/r/ric-plt/sdlgo" - "time" ) var sdl *sdlgo.SyncStorage @@ -60,28 +59,8 @@ func exampleClose() { sdl.Close() } -func sdlNotify(ch string, events ...string) { - fmt.Printf("CB1 channel=%+v, events=%+v\n", ch, events[0]) -} - -func sdlNotify2(ch string, events ...string) { - fmt.Printf("CB2 channel=%+v, events=%+v\n", ch, events[0]) -} - func main() { - sdl.SubscribeChannel("dcapterm_subsRTPM-localhost:55566", sdlNotify, "my-ch") - sdl.SubscribeChannel("dcapterm_subsRTPM-localhost:55565", sdlNotify2, "my-ch") - time.Sleep(3 * time.Second) - sdl.SetAndPublish("dcapterm_subsRTPM-localhost:55566", []string{"my-ch", "my-event1"}, "my-key", "my-data") - sdl.SetAndPublish("dcapterm_subsRTPM-localhost:55565", []string{"my-ch", "my-event2"}, "my-key", "my-data") - - time.Sleep(2 * time.Second) - //sdl.UnsubscribeChannel("dcapterm_subsRTPM-localhost:55565", "my-ch") - //time.Sleep(2 * time.Second) - //sdl.SetAndPublish("dcapterm_subsRTPM-localhost:55565", []string{"my-ch", "my-event2"}, "my-key", "my-data") - time.Sleep(2 * time.Second) - - //exampleSet() - //exampleGet() - //exampleClose() + exampleSet() + exampleGet() + exampleClose() }