简体   繁体   English

Django在不同进程中处理数据

[英]Django processing data in different process

I am currently planning a django project which consists of two parts.我目前正在计划一个由两部分组成的 Django 项目。 The normal django application and an additional application which uses MQTT to read sensors.普通的 django 应用程序和一个使用 MQTT 读取传感器的附加应用程序。 For better loading times for the HTTP responses, I planned to receive the MQTT publish messages in an external process or thread and write it into the database used by django.为了缩短 HTTP 响应的加载时间,我计划在外部进程或线程中接收 MQTT 发布消息,并将其写入 django 使用的数据库中。 The sensor data in this database then is always used whenever a HTTP request is made.每当发出 HTTP 请求时,始终会使用此数据库中的传感器数据。

Do you guys have any better architectural solutions to my problem?你们对我的问题有更好的架构解决方案吗?

Best regards最好的祝福

Django background tasks could be a simple way of doing what you need. Django 后台任务可能是一种简单的方法来完成您需要的事情。

It uses your existing database to run tasks in the background and is very easy to set up.它使用您现有的数据库在后台运行任务并且非常容易设置。 It also supports scheduling repeated tasks.它还支持调度重复任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM