Merge "Move pom for sonar analyses into ricsdl-package"
[ric-plt/sdlpy.git] / ricsdl-package / examples / sync.py
index 24c8fe8..6ea9ef9 100644 (file)
@@ -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.