Module: Ductr::Store::PipelineStore

Includes:
PipelineSerializer
Included in:
Ductr::Store
Defined in:
lib/ductr/store/pipeline_store.rb

Overview

Pipeline’s level store interactions.

Constant Summary collapse

PIPELINE_KEY_PREFIX =

Returns The pipeline key prefix.

Returns:

  • (String)

    The pipeline key prefix

"ductr:pipeline"
PIPELINE_REGISTRY_KEY =

Returns The pipeline registry key.

Returns:

  • (String)

    The pipeline registry key

"ductr:pipeline_registry"

Instance Method Summary collapse

Methods included from PipelineSerializer

#serialize_pipeline

Methods included from JobSerializer

#serialize_job

Instance Method Details

#all_pipelinesArray<SerializedPipeline>

Get all known pipeline instances.

Returns:



21
22
23
# File 'lib/ductr/store/pipeline_store.rb', line 21

def all_pipelines
  all(PIPELINE_REGISTRY_KEY, PIPELINE_KEY_PREFIX)
end

#register_pipeline(pipeline) ⇒ void

This method returns an undefined value.

Add the given pipeline to the store’s pipeline registry. This method is NOT thread-safe.

Parameters:

  • pipeline (Pipeline)

    The job to register



43
44
45
# File 'lib/ductr/store/pipeline_store.rb', line 43

def register_pipeline(pipeline)
  register(PIPELINE_REGISTRY_KEY, pipeline)
end

#write_pipeline(pipeline) ⇒ void

This method returns an undefined value.

Update the given pipeline.

Parameters:

  • pipeline (Pipeline)

    The pipeline to update in the store



32
33
34
# File 'lib/ductr/store/pipeline_store.rb', line 32

def write_pipeline(pipeline)
  write(PIPELINE_KEY_PREFIX, serialize_pipeline(pipeline))
end