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

EventSource endpoint to watch for mentions of a site or url #14

Merged
merged 1 commit into from Dec 6, 2014

Conversation

Projects
None yet
3 participants
@stuartlangridge
Contributor

stuartlangridge commented Nov 30, 2014

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.

Add a new endpoint, /api/mentions/live, which is an EventSource and t…
…herefore gives Instant Gratification to people wanting to know when webmentions have arrived for their sites and urls.
@coveralls

This comment has been minimized.

coveralls commented Nov 30, 2014

Coverage Status

Coverage decreased (-0.51%) when pulling c591cfa on stuartlangridge:master into 0722cda on voxpelli:master.

@voxpelli voxpelli merged commit c591cfa into voxpelli:master Dec 6, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@voxpelli

This comment has been minimized.

Owner

voxpelli commented Dec 6, 2014

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 /api/mentions/live resource and the old /api/mentions one so that all third party webpages can use those two)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment