gochomugo / firecall Goto Github PK
View Code? Open in Web Editor NEWA Python helper library for Firebase. https://firebase.com/
Home Page: https://gochomugo.github.io/firecall
License: MIT License
A Python helper library for Firebase. https://firebase.com/
Home Page: https://gochomugo.github.io/firecall
License: MIT License
when i run the script:
import firebasin
RootRef = firebasin.Firebase("https://xxx.firebaseio.com")
data = RootRef.get_sync("/xxx")
print data
i get this:
Traceback (most recent call last):
File "get.py", line 4, in
data = RootRef.get_sync("/xxx")
AttributeError: 'RootDataRef' object has no attribute 'get_sync'
i also tried with DataRef object instead of RootDataRed with the same luck
thanks in advance
in the async file, there is this code for "stop":
def stop(self, timeout=0):
self.stopwatch = Thread(target=self.__stopper, args=(timeout,)).start()
unfortunately, if you make your timeout VERY long, then even if you make call stop with a timeout of 0, that will stop the request thread but the first watch, with the very long timeout, will have an outstanding thread.
then, it's very hard to close the program. python won't exit with that thread hanging about.
here is one solution.
def stop(self, timeout=0):
t = Thread(target=self.__stopper, args=(timeout,))
t.daemon = True
self.stopwatch = t.start() #Thread(target=self.__stopper, args=(timeout,)).start()
namely, you make the thread that's waiting to STOP the request thread actually watch for exit. this works, i tried it.
anyway, i'm open to other ideas.
Firebase REST endpoints support the EventSource / Server-Sent Events protocol.
from Firebase Docs
This will allow streaming of changes from a single location in the Firebase database.
While we have sort of implemented checking of changes using onChange()
, use of these server-sent events is more efficient.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.