Last active
July 13, 2018 04:49
-
-
Save codeAshu/f6384203706e989b0d38db6e0a9d11e7 to your computer and use it in GitHub Desktop.
Change these two functions in pyrebase to avoid the problem in closing stream.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ClosableSSEClient(SSEClient): | |
def close(self): | |
self.should_connect = False | |
self.retry = 0 | |
try: | |
self.resp.raw._fp.fp._sock.shutdown(socket.SHUT_RDWR) | |
self.resp.raw._fp.fp._sock.close() | |
except AttributeError: | |
pass | |
class Stream: | |
def close(self): | |
while not self.sse and not hasattr(self.sse, 'resp'): | |
time.sleep(0.001) | |
self.sse.running = False | |
self.sse.close() | |
#comment out join | |
# self.thread.join() | |
return self |
The Pyrebase.py file is not editable in raspberry PI in headless mode . what to do, how to do these changes in that file. i have installed pyre base through terminal. please help
@PreshantAhar You can edit the file by logging in to your raspberry pi and use nano or vim to edit the file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the best way to add this to the pyrebase library?