No commit activity in last 3 years
No release in over 3 years
Perform Parse Server operations asynchronously. This is a plugin to the Parse Stack that allows for CRUD operations to be done in a background thread.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.6, ~> 1
 Project Readme

Parse Stack - Async

This Parse Stack plugin adds support for background saves and deletes, similar to the use of saveInBackground and saveEventually in other Parse Server SDKs. It utilizes SuckerPunch to perform the asynchronous processing of the API operation in a separate queue.

Gitter

Installation

Add this line to your application's Gemfile:

gem 'parse-stack-async'

And then execute:

$ bundle

Or install it yourself as:

$ gem install parse-stack-async

Usage

This plugin for Parse Stack allows you to save and delete objects in an asynchronous manner, without blocking the main thread of an application. This is useful when saving objects in a web application like Rails.

This plugin adds two methods to all Parse::Object subclasses: save_eventually and destroy_eventually, which mimic the same API in the mobile SDKs for Parse. These take an optional block that will provide you information whether it was successful in performing the corresponding operation.

require 'parse/stack'
require 'parse/stack/async'

object = Parse::User.first # get a user
object.username = 'newUserName'

# saves object in a background thread.
object.save_eventually do |success|
  puts "Successfully saved in Parse!" if success
end

# Or delete asynchronously
anotherObject.destroy_eventually do |success|
  puts "Deleted object from Parse!" if success
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/modernistik/parse-stack-async.

License

The gem is available as open source under the terms of the MIT License.