module Parse::Stack::Async

This is a plugin to Parse Stack that allows objects to be saved and deleted in a background thread, while providing you a callback block.

Constants

VERSION

Version number for this gem

Public Class Methods

run(type = :parallel) click to toggle source

Helper method to run a block on a background thread. @param type [Symbol] the queue to use when dispatching the block.

* :serial - add the request to a serial queue.
* :parallel - add the request to a concurrent queue.
# File lib/parse/stack/async.rb, line 44
def self.run(type = :parallel)
  raise "You need to pass a block to async." unless block_given?
  if type == :parallel
    ParallelDispatchQueue.perform_async Proc.new
  else
    SerialDispatchQueue.perform_async Proc.new
  end
end