Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
EventSource endpoint to watch for mentions of a site or url #14
Add a new endpoint, /api/mentions/live, which is an EventSource and therefore gives Instant Gratification to people wanting to know when webmentions have arrived for their sites and urls.
This would be a good fix for #11 if it had tests, which it doesn't, because I'm not sure how to test multiple listener stuff in the test framework.
Also, keeping this stuff in one big dict in memory is problematic if the service gets big enough to have lots of people listening, and totally stops working if the server gets sharded, but those are problems for another day.
Thanks for the PR @stuartlangridge!
I added a Postgres Pubsub mechanism and made it so that the full WebMentions objects are returned in the EventSource notification.
I also added the EventSource listener to the embed-script that others use so everyone using the hub will now automatically have realtime updates – which is great! Thanks for pushing for this :)
(I also added CORS to both this new