Suggestions on handling additions and removals from collections?

17 views
Skip to first unread message

Joseph Weissman

unread,
Apr 8, 2013, 9:11:40 PM4/8/13
to fireh...@googlegroups.com
Maybe I'm missing something about the intended workflow, but I could use some guidance on how to think through adding and removing elements from collections. 

My thought is to have two routes: /resources.json for the collection, which gets creation/deletion updates, and /resource/:id.json for the instances. I'm trying to get a sense for what a good way of signalling that the collection has been modified. The case of insertion seems straightforward -- we can just pass the model's own to_json to the collection stream. The deletion could just be a flag that we set here; I guess I'm trying to get a sense of whether beginning to layer a 'higher-order' of services over firehose or just do those sort of things out of band, with a custom websocket solution (that seems repetitive, but...) 

Anyway, really enjoying the service and just trying to grok how a good RESTful handling of collections might be achieved. Thanks!

Brad Gessler

unread,
Apr 9, 2013, 2:18:43 AM4/9/13
to fireh...@googlegroups.com
Yep! This is the vision for Firehose. We have a few more details in mind for how to accomplish this:

1. Client binds to a Firehose resource, "/users/:id/polls"

2. Firehose proxies this request to the web app server, grabs the collection of polls upstream, and responds with this payload to the downstream Firehose client.

3. Firehose enters a mode where its listening for updates to items in the collection… so full CRUD (you need to keep the Firehose client informed of updates to items in the collection, so its more than create/delete).

4. Magic happens.

Singular resources are pretty easy! 

The cool thing about this higher order streaming REST approach is that you could pretty easily hook this into Rails resources and make them push updates in realtime.

Let me know if you get serious about jumping into this and need some help getting started. I'd love to see more forks of Firehose that get close to this goal.

Brad

--
You received this message because you are subscribed to the Google Groups "FirehoseIO" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firehoseio+...@googlegroups.com.
To post to this group, send email to fireh...@googlegroups.com.
Visit this group at http://groups.google.com/group/firehoseio?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages