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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Push notifications instead of polling #3

Closed
vjekob opened this issue Sep 11, 2021 · 5 comments
Closed

Enhancement: Push notifications instead of polling #3

vjekob opened this issue Sep 11, 2021 · 5 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@vjekob
Copy link
Owner

vjekob commented Sep 11, 2021

Problem

Right now (v1.0.3) notifications are being pulled from the back end with polling interval of 15 seconds. This is poor man's approach, but to make this cool feature work in time for yesterday's beerinar demo, I had to hack something quickly.

Needless to say, this can't stay that way.

Possible approaches

I looked at some frameworks, but haven't really figured out anything useful just yet.

If you have an idea about which push notifications framework I should use, do let me know.

These are requirements:

  • It must be absolutely free to use (or if it costs $, then it must be part of Azure stack and count towards Azure consumption)
  • It must work on nodejs client-side.

Any ideas?

@vjekob vjekob added enhancement New feature or request help wanted Extra attention is needed labels Sep 11, 2021
@martonsagi
Copy link

I would give Azure Event Grid a try. Pricing seems low-cost for this purpose.

Disclaimer: I did not use it before, but this is what I'd use for myself. :-)

@vjekob
Copy link
Owner Author

vjekob commented Sep 12, 2021

The problem is not pushing events from my Azure Functions back end - that's the easy part. The problem is consuming events from nodejs. There is nothing that Azure Event Grid can push events to that can be consumed with a ready-made nodejs client library, at least from what I could find so far.

But thanks for the hint, when I focus on this feature, I'll investigate deeper.

@martonsagi
Copy link

Perhaps Service Bus could work, that has a connection string that you can connect to from clients. Although, based on the examples, it's still like an endless loop to get updates, not specifically event-based. A tiny step away from a timer :D

https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-nodejs-how-to-use-queues

@vjekob
Copy link
Owner Author

vjekob commented Sep 14, 2021

From the example it seems that this is actual tunnel/socket thing, not a polling thing. The example at that page gives 2s delay to stop processing just because it's a demo, but if I'd connect to the bus from a Disposable and then disconnect from its dispose it could easily work.

The only problem is that queue is first-come-first served. If I have fifteen clients to notify, only the first to fetch the message from the queue would actually get notified...

So... back to square one, really. I'll investigate deeper about Event Grid, there must be something I can use from there.

@vjekob
Copy link
Owner Author

vjekob commented Oct 1, 2021

I am closing this. There won't be anything but polling for the foreseeable future. All other options are going to cost more as far as I can tell from checking the pricing options available. Also, third-party options are going to cost a lot more. Unfortunately, for a free service, I have to keep costs down. So that's it.

At some future point I may do a peer-to-peer notification system, that would make sense, even though it would require some local configuration.

So, for now, that's it. Case closed.

@vjekob vjekob closed this as completed Oct 1, 2021
@vjekob vjekob added wontfix This will not be worked on and removed help wanted Extra attention is needed labels Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants