X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=ricsdl-package%2Fexamples%2Fsync.py;h=6ea9ef91d7618b5aac70e697ca609f00646be547;hb=bef156a640df036aa97fe1f2656c54a5717fc12b;hp=24c8fe8498c4f42f98857468a41640f14f211375;hpb=276ed3c833c81a4142d7c4607474ee95a7f01355;p=ric-plt%2Fsdlpy.git diff --git a/ricsdl-package/examples/sync.py b/ricsdl-package/examples/sync.py index 24c8fe8..6ea9ef9 100644 --- a/ricsdl-package/examples/sync.py +++ b/ricsdl-package/examples/sync.py @@ -73,6 +73,16 @@ def _try_func_return(func): # Creates SDL instance. The call creates connection to the SDL database backend. mysdl = _try_func_return(SyncStorage) +# Creates SDL instance what utilizes a fake database backend. Fake database is meant to +# be used only at development phase of SDL clients. It does not provide more advanced +# database services. +# mysdl = _try_func_return(lambda: SyncStorage(fake_db_backend='dict')) + +# Checks if SDL is operational. Note that it is not necessary to call `is_active()` after each +# SDL instance creation. Below example is here just to show how to call it spontaneously +# when SDL healthiness is needed to check. +is_active = mysdl.is_active() +assert is_active is True # Sets a value 'my_value' for a key 'my_key' under given namespace. Note that value # type must be bytes and multiple key values can be set in one set function call.