-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial commit - FR: realtime event listener for RTDB (#229) #245
base: dev
Are you sure you want to change the base?
Conversation
Thanks @johndelavega. The general shape of things look good. However the SSE sessions will die after an hour, when the underlying credential becomes invalid. You will need a way to reconnect when this happens. Also try to use the APIs in the |
Thanks for the feedback. Will work on the fix to reconnect. Will use |
Here's a fix for the timeout reconnection. The code is tested and continued running for over 2 days. The tested use case is similar to if we have a The JSON file is created from This tool create-refresh-token can be used to create the JSON file. This admin SDK can also be used as a client SDK, similar to Node.js SDK |
Updated to use This |
db/event_ref.go
Outdated
|
||
var snapshotMap map[string]interface{} | ||
|
||
err := json.Unmarshal([]byte(s[6:]), &snapshotMap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to comment why you've used a constant here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I've added comments from a recent commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thatreguy I think you need to sign a CLA https://cla.developers.google.com/
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
uses 2 simultaneous Listeners Unmarshal json-encoded event data
firebase#229) added SnapshotIterator.Done() updated test apps fixed variable scope for resp *http.Response
firebase#229) added comments in db/event_ref.go
b8d59e4
to
7b1eda5
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
rebased branch jd-event-listener with upstream/master 'Bumped version to 3.9.0 ...' removed branch dev
Any update on this? |
Any updates on this ? |
I think they are not going to work on this, sad. |
Here's a pull request against
dev
see cmd/listen/main.go for working simple test client app
To run the test app, edit main.go for credential json file location "edit 1." and db url "edit 2."
then from command line terminal, cd to cmd/listen
go run . init
- creates snapshot user1/path1/key1:"init" for listener testinggo run .
- starts listeningstart a new command line terminal, cd to cmd/listen
go run . hey
- this will trigger an event and should show up from other cmd line listenerHere's the gist of the code:
FR #229