Commit 168e818a authored by C. Albrecht's avatar C. Albrecht
Browse files

feature: Add a prototype for routines

parent 22e29441
......@@ -13,6 +13,7 @@
from s3i.messages import ServiceReply, GetValueReply, SetValueReply
from import find_broker_endpoint
from ml.app_logger import APP_LOGGER
from routines import Send_Message
class BaseVariable:
......@@ -112,6 +113,27 @@ def model(self):
return self.__model
def stanford2010(self):
return self.__stanford2010
def stanford2010(self, value):
self.__stanford2010 = value
def db(self):
return self.__db
def add_startup_code():
def add_routine(func, frequence):
def add_shutodwn_code():
def ditto_features(self):
return self.__ditto_features
......@@ -238,8 +260,18 @@ def run_forever(self):
if self.__is_repo:
def add_user_def(func):
for func in self.user_func_list:
# TODO: Compare id
if thing_id == "s3i:...":
# TODO: Construct Send_Message object
endpoints = [""]
send_message = Send_Message(self, endpoints)
def add_user_def(self, func):
"""Insert user-specified function in the thing object.
:param func: external defined function to be executed.
from import make_sub_thing
from ml.thing import Thing
from s3i.message import UserMessage
class Send_Message:
def __init__(self, thing, endpoints, message="") -> None:
self.thing = thing
self.endpoints = endpoints
def work():
# TODO: Fill message
# TODO: Send message to proper endpoint
msg = UserMessage()
endpoints = ["s3ib://s3i..."]
thing.__send_message_to_broker(endpoints, msg)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment