Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add limiters on function triggers/events #1625

Closed
Pastajello opened this issue Sep 15, 2021 · 2 comments
Closed

Add limiters on function triggers/events #1625

Pastajello opened this issue Sep 15, 2021 · 2 comments
Labels
api / realtime Fixes and upgrades for the Appwrite Realtime API. product / functions Fixes and upgrades for the Appwrite Functions.

Comments

@Pastajello
Copy link

Pastajello commented Sep 15, 2021

Hello

馃殌 Feature

I'd like to have some limiters on functions - especially in documents 'section' so we can have a dedicated function just for this collection that get triggered only when something in collection gets changed.
obraz

Have you spent some time to check if this issue has been raised before?

Yup

Have you read the Code of Conduct?

Yup

Pitch

Currently the event triggers do not consider anything when executing a function.
Lets say we have a chat app, we want to create a PushNotification only on 'new friend request'. Now, with how things are done we must manually check if the collection being updated/added to is 'friends'. As its a chat app most of new documents get added to 'messages' so our function gets triggered every 0.1s because people keep talking instead of 1 per day when they get new 'friend'.

With a 'limiter' we would only trigger a function on a 'friend' collection update. Considering that people have a lot of small functions that check for some documents creations for notiications the execution hell can be quite big.

@TorstenDittmann
Copy link
Contributor

TorstenDittmann commented Sep 21, 2021

We were thinking about extending the events to the way we are managing channels with realtime.

https://appwrite.io/docs/realtime#channels

This way you would have more control. Not sure if this would fix the create/update problem, but it lets you narrow down for what resources functions are triggered in the first place.

@stnguyen90 stnguyen90 added product / functions Fixes and upgrades for the Appwrite Functions. api / realtime Fixes and upgrades for the Appwrite Realtime API. labels Jan 19, 2023
@stnguyen90
Copy link
Contributor

Closing as this should be possible now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api / realtime Fixes and upgrades for the Appwrite Realtime API. product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

No branches or pull requests

3 participants