From: Timo Tietavainen Date: Tue, 22 Mar 2022 13:39:04 +0000 (+0200) Subject: Revert previous sdlgo example change X-Git-Tag: v0.10.1~1 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=59c60ebc4ca8edd65fd9cdc1e833309f3e8bc8fe;p=ric-plt%2Fsdlgo.git Revert previous sdlgo example change Revert example.go change done by the commit 6ffe956f91, because that change was a mishap. Issue-Id: RIC-893 Signed-off-by: Timo Tietavainen Change-Id: I0566eba4ca70f735a2bf5da755c44752618e98d3 --- 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() }