Trying to 'push' a value via flask #402
Replies: 3 comments 1 reply
-
This bit of code: test_av.statusFlags = str(args['statusflags']) It run in the context of deferred(setattr, test_av, 'statusFlags', StatusFlags(args['statusflags'])) |
Beta Was this translation helpful? Give feedback.
-
Ugh! This is much harder than I expected. With flask and BACpypes running in separate processes, it much harder to exchange content between them, using shared memory would require serializing the object and some kind of handshake for knowing when the shared version of the object is current. Perhaps if flask was running in the main thread and you had BACpypes running in a separate thread it would be manageable, but I don't know how that would work with misty and I don't have any way of testing it. I attempted to build this using just IPv4 and not MSTP and running flask with debug=True makes it fail because it attempts to build the stack twice and the port binding fails. So the call to |
Beta Was this translation helpful? Give feedback.
-
BAC0 have something that works but far from optimal.
Have a look to the repo.
Le jeu. 6 mai 2021 à 17:52, Joel Bender ***@***.***> a écrit :
… Ugh! This is much harder than I expected. With flask and BACpypes running
in separate processes, it much harder to exchange content between them,
using shared memory
<https://docs.python.org/3/library/multiprocessing.shared_memory.html>
would require serializing the object and some kind of handshake for knowing
when the shared version of the object is current. Perhaps if flask was
running in the main thread and you had BACpypes running in a separate
thread it would be manageable, but I don't know how that would work with
misty and I don't have any way of testing it.
I attempted to build this using just IPv4 and not MSTP and running flask
with debug=True makes it fail because it attempts to build the stack twice
and the port binding fails.
So the call to deferred() that I suggested works for threads but not
multiple processes.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#402 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQUXBYEVION2BIVS462JMTTMMFR7ANCNFSM43RJ45MA>
.
|
Beta Was this translation helpful? Give feedback.
-
I am trying to 'push' a value via flask in a GET request so I could access it via node-red, and would actually like to edit some values in a POST request, would be great if you had the time to review my code and point me on what I am doing wrong. Thanks
Code: https://pastebin.com/naHWjJ4G
Beta Was this translation helpful? Give feedback.
All reactions