Skip to content

Commit

Permalink
Add support events filtering in Realtime database SSE mode (HTTP Stre…
Browse files Browse the repository at this point in the history
…aming) result
  • Loading branch information
mobizt committed May 18, 2024
1 parent eb74570 commit 30922ba
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions examples/RealtimeDatabase/Async/Callback/Stream/Stream.ino
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void setup()
Database.url(DATABASE_URL);

// Filtering response payload from SSE mode (HTTP Streaming).
// This is optional option to allow specific events filtering.
// This is optional to allow specific events filtering.

// The following event keywords are supported.
// get - Allow the http get response (first put event since stream connected).
Expand All @@ -126,7 +126,7 @@ void setup()
// cancel - Allow the cancel event.
// auth_revoked - Allow the auth_revoked event.
// Call RealtimeDatabase::setSSEFilters() for clear the filter to allow all events.
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked");
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked"); // Since v1.2.1

// The "unauthenticate" error can be occurred in this case because we don't wait
// the app to be authenticated before connecting the stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ void setup()
Database.url(DATABASE_URL);

// Filtering response payload from SSE mode (HTTP Streaming).
// This is optional option to allow specific events filtering.
// This is optional to allow specific events filtering.

// The following event keywords are supported.
// get - Allow the http get response (first put event since stream connected).
// put - Allow the put event.
Expand All @@ -131,11 +131,11 @@ void setup()
// cancel - Allow the cancel event.
// auth_revoked - Allow the auth_revoked event.
// Call RealtimeDatabase::setSSEFilters() for clear the filter to allow all events.
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked");
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked"); // Since v1.2.1

// The "unauthenticate" error can be occurred in this case because we don't wait
// The "unauthenticate" error can be occurred in this case because we don't wait
// the app to be authenticated before connecting the stream.
// This is ok as stream task will be reconnected automatically when the app is authenticated.
// This is ok as stream task will be reconnected automatically when the app is authenticated.

Database.get(aClient1, "/test/stream/path1", asyncCB, true /* SSE mode (HTTP Streaming) */, "streamTask1");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void setup()
Database.url(DATABASE_URL);

// Filtering response payload from SSE mode (HTTP Streaming).
// This is optional option to allow specific events filtering.
// This is optional to allow specific events filtering.

// The following event keywords are supported.
// get - Allow the http get response (first put event since stream connected).
Expand All @@ -190,7 +190,7 @@ void setup()
// cancel - Allow the cancel event.
// auth_revoked - Allow the auth_revoked event.
// Call RealtimeDatabase::setSSEFilters() for clear the filter to allow all events.
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked");
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked"); // Since v1.2.1

// The "unauthenticate" error can be occurred in this case because we don't wait
// the app to be authenticated before connecting the stream.
Expand Down
10 changes: 5 additions & 5 deletions examples/RealtimeDatabase/Async/NoCallback/Stream/Stream.ino
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ void setup()
Database.url(DATABASE_URL);

// Filtering response payload from SSE mode (HTTP Streaming).
// This is optional option to allow specific events filtering.
// This is optional to allow specific events filtering.

// The following event keywords are supported.
// get - Allow the http get response (first put event since stream connected).
// put - Allow the put event.
Expand All @@ -125,11 +125,11 @@ void setup()
// cancel - Allow the cancel event.
// auth_revoked - Allow the auth_revoked event.
// Call RealtimeDatabase::setSSEFilters() for clear the filter to allow all events.
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked");
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked"); // Since v1.2.1

// The "unauthenticate" error can be occurred in this case because we don't wait
// The "unauthenticate" error can be occurred in this case because we don't wait
// the app to be authenticated before connecting the stream.
// This is ok as stream task will be reconnected automatically when the app is authenticated.
// This is ok as stream task will be reconnected automatically when the app is authenticated.

Database.get(aClient, "/test/stream", aResult_no_callback1, true /* SSE mode (HTTP Streaming) */);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ void setup()
Database.url(DATABASE_URL);

// Filtering response payload from SSE mode (HTTP Streaming).
// This is optional option to allow specific events filtering.
// This is optional to allow specific events filtering.

// The following event keywords are supported.
// get - Allow the http get response (first put event since stream connected).
// put - Allow the put event.
Expand All @@ -130,11 +130,11 @@ void setup()
// cancel - Allow the cancel event.
// auth_revoked - Allow the auth_revoked event.
// Call RealtimeDatabase::setSSEFilters() for clear the filter to allow all events.
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked");
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked"); // Since v1.2.1

// The "unauthenticate" error can be occurred in this case because we don't wait
// The "unauthenticate" error can be occurred in this case because we don't wait
// the app to be authenticated before connecting the stream.
// This is ok as stream task will be reconnected automatically when the app is authenticated.
// This is ok as stream task will be reconnected automatically when the app is authenticated.

Database.get(aClient1, "/test/stream/path1", aResult_no_callback1, true /* SSE mode (HTTP Streaming) */);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ void setup()
Database.url(DATABASE_URL);

// Filtering response payload from SSE mode (HTTP Streaming).
// This is optional option to allow specific events filtering.
// This is optional to allow specific events filtering.

// The following event keywords are supported.
// get - Allow the http get response (first put event since stream connected).
// put - Allow the put event.
Expand All @@ -189,11 +189,11 @@ void setup()
// cancel - Allow the cancel event.
// auth_revoked - Allow the auth_revoked event.
// Call RealtimeDatabase::setSSEFilters() for clear the filter to allow all events.
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked");
Database.setSSEFilters("get,put,patch,keep-alive,cancel,auth_revoked"); // Since v1.2.1

// The "unauthenticate" error can be occurred in this case because we don't wait
// The "unauthenticate" error can be occurred in this case because we don't wait
// the app to be authenticated before connecting the stream.
// This is ok as stream task will be reconnected automatically when the app is authenticated.
// This is ok as stream task will be reconnected automatically when the app is authenticated.

Database.get(aClient2, "/test/stream", aResult_no_callback2, true /* SSE mode */);
}
Expand Down
2 changes: 1 addition & 1 deletion resources/docs/realtime_database.md
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ class RealtimeDatabase

Filtering response payload for SSE mode (HTTP Streaming).

This is optional option to allow specific events filtering.
This is optional to allow specific events filtering.

The following event keywords are supported.

Expand Down
2 changes: 2 additions & 0 deletions src/database/RealtimeDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,8 @@ class RealtimeDatabase : public RTDBResultBase
* Filtering response payload for SSE mode (HTTP Streaming).
* @param filter The event keywords for filtering.
*
* This is optional to allow specific events filtering.
*
* The following event keywords are supported.
* get - Allow the http get response (first put event since stream connected).
* put - Allow the put event.
Expand Down

0 comments on commit 30922ba

Please sign in to comment.