-
Notifications
You must be signed in to change notification settings - Fork 67
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
Alternative adapters? #132
Comments
There is the SQL branch, which uses FMDB as a backing store. I've not used it because my needs are more for a backing store with some data manipulation capability instead of a major database search/sort kind of thing. I've also done some strawman integrations with Meteor DDP and with Firebase, but the code is preliminary. What is the use case that makes |
Well I can load my data and then display it, but when the app gets killed in the background I want to have some data ready cached. |
I simply set an observer on the ################ Persistence Is Handled in Asynchronous Queue #################
def observe_change
@model_change_observer = App.notification_center.observe MotionModelDataDidChangeNotification do |notification|
queue = Dispatch::Queue.concurrent('com.calicowebdev.whos_here.task')
queue.async{
begin
save_one(notification.object.class)
rescue MotionModel::PersistFileError => ex
App.notification_center.post MotionModelPersistFileError, Time.now,
{:status => 'failure', :exception => ex.message}
end
file_sizes
}
end
end I have a slightly more elegant version that creates a block that observes a given model, but this should give you an idea how I set it up. It will persist changes across settings every time you save/update/delete a collection. |
Is there a list of alternative adapters anywhere?
MotionModel::ArrayModelAdapter
is a nice starting point but a bit useless beyond initial experiments.The text was updated successfully, but these errors were encountered: