diff asyncio_threads/database/main.py @ 48:46daba6e3cf4

Few python scrtips to show how to use asychio.
author MrJuneJune <me@mrjunejune.com>
date Sat, 13 Dec 2025 14:23:02 -0800
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/asyncio_threads/database/main.py	Sat Dec 13 14:23:02 2025 -0800
@@ -0,0 +1,16 @@
+class Database:
+
+    def __init__(self):
+        self.db = {}
+        self.state = 'idle'
+
+    def set(self, key, value):
+        self.db[key] = value
+
+    def get(self, key):
+        return self.db[key]
+
+    def unset(self, key):
+        del self.db[key]
+
+