View Source OffBroadway.Elasticsearch.SliceStrategy (OffBroadwayElasticsearch v0.1.0)
Implementation of OffBroadway.Elasticsearch.Strategy
that's suitable
for concurrent reading. Slices are determined by the concurrency
option passed into the Broadway producer
options.
Example
defmodule MyBroadway do
use Broadway
def start_link(_opts) do
Broadway.start_link(__MODULE__,
...
producer: [
module: {
OffBroadway.Elasticsearch.Producer,
[
host: "http://localhost:9200",
index: "my-index",
strategy: :slice, # <- Select the 'slice' strategy
search: search() # <- Provide a search query
]
},
concurrency: 5 # <- Determines the max number of sliced search contexts to be created
],
...
)
end
end
See Elasticsearch docs: Sliced Scroll
Summary
Types
@type broadway_state() :: OffBroadway.Elasticsearch.broadway_state()
@type document() :: OffBroadway.Elasticsearch.document()