Module: LogStash::PluginMixins::Scheduler::SchedulerInterface

Included in:
RufusImpl::SchedulerAdapter
Defined in:
lib/logstash/plugin_mixins/scheduler.rb

Overview

Scheduler interface usable by plugins.

Instance Method Summary collapse

Instance Method Details

#at(timestamp, opts = {}, &task) ⇒ Object

This method is abstract.

Returns a job object which responds to a #job_id method.

Returns:

  • a job object which responds to a #job_id method



91
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 91

def at(timestamp, opts = {}, &task); fail NotImplementedError end

#cron(schedule, opts = {}, &task) ⇒ Object

This method is abstract.

Returns a job object which responds to a #job_id method.

Returns:

  • a job object which responds to a #job_id method



85
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 85

def cron(schedule, opts = {}, &task); fail NotImplementedError end

#every(period, opts = {}, &task) ⇒ Object

This method is abstract.

Returns a job object which responds to a #job_id method.

Returns:

  • a job object which responds to a #job_id method



88
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 88

def every(period, opts = {}, &task); fail NotImplementedError end

#in(delay, opts = {}, &task) ⇒ Object

This method is abstract.

Returns a job object which responds to a #job_id method.

Returns:

  • a job object which responds to a #job_id method



94
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 94

def in(delay, opts = {}, &task); fail NotImplementedError end

#interval(interval, opts = {}, &task) ⇒ Object

This method is abstract.

Returns a job object which responds to a #job_id method.

Returns:

  • a job object which responds to a #job_id method



97
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 97

def interval(interval, opts = {}, &task); fail NotImplementedError; end

#joinObject

This method is abstract.

Blocks until all jobs are joined, including jobs that are scheduled after this join has begun blocking.



102
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 102

def join; fail NotImplementedError end

#releaseObject

This method is abstract.

Release the scheduler:

  • prevents additional jobs from being registered,
  • and unschedules all future invocations of jobs previously registered

This operation does not block until the scheduler stops executing jobs.



110
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 110

def release; fail NotImplementedError end

#release!Object

This method is abstract.

Release the scheduler:

  • prevents additional jobs from being registered,
  • and unschedules all future invocations of jobs previously registered

This operation attempts to WAIT until the scheduler operation completes (if supported).



118
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 118

def release!; release end

#running?Boolean

This method is abstract.

Is this scheduler potentially executing our jobs.

Returns:

  • (Boolean)

See Also:



132
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 132

def running?; fail NotImplementedError end

#terminate!Object

This method is abstract.

Fully and immediately terminate the scheduler:

  • prevents additional jobs from being registered,
  • unschedules all future invocations of jobs previously registered,
  • and stops any jobs currently executing.


126
# File 'lib/logstash/plugin_mixins/scheduler.rb', line 126

def terminate!; release! end