Skip to content

Commit 3434aeb

Browse files
authored
Merge pull request #561 from rabryan/master
implements plotly.Stream 'connected' property
2 parents fe1f76e + ba5b8f1 commit 3434aeb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: plotly/plotly/plotly.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ def __init__(self, stream_id):
454454
455455
"""
456456
self.stream_id = stream_id
457-
self.connected = False
458457
self._stream = None
459458

460459
def get_streaming_specs(self):
@@ -500,6 +499,13 @@ def heartbeat(self, reconnect_on=(200, '', 408)):
500499
"cannot write to a closed connection. "
501500
"Call `open()` on the stream to open the stream."
502501
)
502+
503+
@property
504+
def connected(self):
505+
if self._stream is None:
506+
return False
507+
508+
return self._stream._isconnected()
503509

504510
def open(self):
505511
"""

0 commit comments

Comments
 (0)