Module: Arango::Server::Tasks
- Included in:
- Arango::Server
- Defined in:
- lib/arango/server/tasks.rb
Overview
Arango Server Tasks
Instance Method Summary collapse
-
#all_tasks ⇒ Array<Arango::Task>
Get all tasks.
-
#create_task(id: nil, command:, name: nil, offset: nil, params: nil, period: nil) ⇒ Arango::Task
Create a new task with given id, task is saved to the database.
-
#drop_task(id:) ⇒ Boolean
(also: #delete_task, #destroy_task)
Delete task with given id.
-
#get_task(id:) ⇒ Arango::Task
(also: #fetch_task, #retrieve_task)
Get a task from the server.
-
#list_tasks ⇒ Array<String>
Get a list of all task ids.
-
#new_task(id: nil, command: nil, name: nil, offset: nil, params: nil, period: nil) ⇒ Arango::Task
Instantiate a new task with given id, task is not saved to the database.
-
#task_exists?(id:) ⇒ Boolean
Checks existence of a task.
Instance Method Details
#all_tasks ⇒ Array<Arango::Task>
Get all tasks.
10 11 12 |
# File 'lib/arango/server/tasks.rb', line 10 def all_tasks Arango::Task.all(server: self) end |
#create_task(id: nil, command:, name: nil, offset: nil, params: nil, period: nil) ⇒ Arango::Task
Create a new task with given id, task is saved to the database.
22 23 24 |
# File 'lib/arango/server/tasks.rb', line 22 def create_task(id: nil, command:, name: nil, offset: nil, params: nil, period: nil) Arango::Task.new(id: id, command: command, name: name, offset: offset, params: params, period: period, server: self).create end |
#drop_task(id:) ⇒ Boolean Also known as: delete_task, destroy_task
Delete task with given id.
56 57 58 |
# File 'lib/arango/server/tasks.rb', line 56 def drop_task(id:) Arango::Task.delete(id: id, server: self) end |
#get_task(id:) ⇒ Arango::Task Also known as: fetch_task, retrieve_task
Get a task from the server.
29 30 31 |
# File 'lib/arango/server/tasks.rb', line 29 def get_task(id:) Arango::Task.get(id: id, server: self) end |
#list_tasks ⇒ Array<String>
Get a list of all task ids.
49 50 51 |
# File 'lib/arango/server/tasks.rb', line 49 def list_tasks Arango::Task.list(server: self) end |
#new_task(id: nil, command: nil, name: nil, offset: nil, params: nil, period: nil) ⇒ Arango::Task
Instantiate a new task with given id, task is not saved to the database.
43 44 45 |
# File 'lib/arango/server/tasks.rb', line 43 def new_task(id: nil, command: nil, name: nil, offset: nil, params: nil, period: nil) Arango::Task.new(id: id, command: command, name: name, offset: offset, params: params, period: period, server: self) end |
#task_exists?(id:) ⇒ Boolean
Checks existence of a task.
65 66 67 |
# File 'lib/arango/server/tasks.rb', line 65 def task_exists?(id:) Arango::Task.exists?(id: id, server: self) end |