Closed smurthas closed 12 years ago
I need at least one person to test this:
count
)/Me/contacts
/Me/contacts/
/Me/contacts?limit=10&offset=25
/Me/contacts/state
/Me/contacts/since?id=
/Me/photos
/Me/photos/
/Me/photos?limit=10&offset=25
/Me/photos/state
/Me/photos/since?id=
/Me/places
/Me/places/
/Me/places?limit=10&offset=25
/Me/places/state
/Me/places/since?id=
/Me/links
/Me/links/
/Me/links?limit=10&offset=25
/Me/links/state
/Me/links/since?id=
Dude, kudos, this was quite the undertaking, moving a lot of logic around, thanks! It feels like a solid step towards some generalized collection functionality too, a pattern that could start to be applied to the data processing as well (I've had some ideas here, making this look more like synclets).
One caveat is this will increase the ram in the core process, and any bugs will bring the whole ship down, but the work @temas is doing with synclets using vm contexts as isolation might work perfectly here too.
Now to do some testing :)
I ran this with every app, and I also tested the memory impact on my mac between the two for lockerd node process. By including the apis in the main process it only bumped up RSS by 2MB, not bad.
The collections can now (optionally) expose an api.js file in their src dir and it will be required in by core and add it's endpoints (GET only right now). This is intended to enable collection processes to turn themselves off more often (only need to run for data processing) and (hopefully) enabled better process priority control (nice down processing, while leaving core at normal priority).
This also add Common/node/collectionDataStore, which abstracts several common data store patterns in collections. Next step is to make some of the API methods common, but I'd rather merge (and deploy) this first.
This passes all tests, but they're aren't really a ton of collection tests. I'd be happy to write more, but if we are moving away from vows it feels like a waste (tell me I'm wrong!). I did auth all connectors to ensure data processing works properly and hit all API endpoints to make sure they work.