Closing Stream in provided demo #504
Unanswered
robot-ranger
asked this question in
Q&A
Replies: 3 comments
-
I have verified that questioning if i am not using the abort controller correctly |
Beta Was this translation helpful? Give feedback.
0 replies
-
@wsobel - any input here? I cant seem to figure out how to close a running stream programmatically. |
Beta Was this translation helpful? Give feedback.
0 replies
-
It looks like the protocol may keep running. We may need to put a flag in to stop the loop and exit streaming. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
what is the proper way to abort/close the stream in the demo code? In our react app, I would like to close the stream when the components un-mount (ex user navigates away).
I tried calling
controller.abort()
. I get anAbortError
exception, which i suppose is expected, but it seems like data continues to arrive.I continue getting the console print on this line:
cppagent/demo/twin/lib/mtconnect/protocol.js
Line 119 in d6bc710
Even after running
controller.abort
and navigating away. It doesnt appear to have actually aborted?Beta Was this translation helpful? Give feedback.
All reactions