Module: Arango::Server::Async
- Defined in:
- lib/arango/server/async.rb
Overview
Arango Server Async
Instance Method Summary collapse
- #cancel_async(id:) ⇒ Object
- #destroy_all_async ⇒ Object
- #destroy_async(id:, stamp: nil) ⇒ Object
- #destroy_async_by_type(type:, stamp: nil) ⇒ Object
- #destroy_expired_async ⇒ Object
-
#fetch_async(id:) ⇒ Object
ASYNC ===.
- #retrieve_async(id:) ⇒ Object
- #retrieve_async_by_type(type:, count: nil) ⇒ Object
- #retrieve_done_async(count: nil) ⇒ Object
- #retrieve_pending_async(count: nil) ⇒ Object
Instance Method Details
#cancel_async(id:) ⇒ Object
12 13 14 |
# File 'lib/arango/server/async.rb', line 12 def cancel_async(id:) request("PUT", "_api/job/#{id}/cancel", key: :result) end |
#destroy_all_async ⇒ Object
27 28 29 |
# File 'lib/arango/server/async.rb', line 27 def destroy_all_async destroy_async_by_type(type: "all") end |
#destroy_async(id:, stamp: nil) ⇒ Object
16 17 18 19 |
# File 'lib/arango/server/async.rb', line 16 def destroy_async(id:, stamp: nil) query = {stamp: stamp} request("DELETE", "_api/job/#{id}", query: query, key: :result) end |
#destroy_async_by_type(type:, stamp: nil) ⇒ Object
21 22 23 24 25 |
# File 'lib/arango/server/async.rb', line 21 def destroy_async_by_type(type:, stamp: nil) satisfy_category?(type, %w[all expired]) query = {stamp: stamp} request("DELETE", "_api/job/#{type}", query: query) end |
#destroy_expired_async ⇒ Object
31 32 33 |
# File 'lib/arango/server/async.rb', line 31 def destroy_expired_async destroy_async_by_type(type: "expired") end |
#fetch_async(id:) ⇒ Object
ASYNC ===
8 9 10 |
# File 'lib/arango/server/async.rb', line 8 def fetch_async(id:) request("PUT", "_api/job/#{id}") end |
#retrieve_async(id:) ⇒ Object
35 36 37 |
# File 'lib/arango/server/async.rb', line 35 def retrieve_async(id:) request("GET", "_api/job/#{id}") end |
#retrieve_async_by_type(type:, count: nil) ⇒ Object
39 40 41 42 |
# File 'lib/arango/server/async.rb', line 39 def retrieve_async_by_type(type:, count: nil) satisfy_category?(type, %w[done pending]) request("GET", "_api/job/#{type}", query: {count: count}) end |
#retrieve_done_async(count: nil) ⇒ Object
44 45 46 |
# File 'lib/arango/server/async.rb', line 44 def retrieve_done_async(count: nil) retrieve_async_by_type(type: "done", count: count) end |
#retrieve_pending_async(count: nil) ⇒ Object
48 49 50 |
# File 'lib/arango/server/async.rb', line 48 def retrieve_pending_async(count: nil) retrieve_async_by_type(type: "pending", count: count) end |