Shopify.GraphQL.Limiter.Producer (shopify_graphql v1.5.1)
Link to this section Summary
Functions
Returns the number of events queued by a producer.
Begins the process of waiting for a shop's cost bucket to drain.
Returns whether the producer is currently waiting for a shop's cost bucket to drain.
Determines whether a producer is in an idle state.
Returns the name of a Shopify.GraphQL.Limiter.Producer
process.
Synchronously processes a request.
Puts the producer in a restored state and restarts processing requests.
Adds a request to the front of the processing queue.
Starts a Shopify.GraphQL.Limiter.Producer
process and links it to the
supervision tree.
Stops the producer from fulfilling demand.
Returns the throttle status.
Starts demand fulfillment.
Link to this section Functions
count(server)
Specs
count(GenStage.stage()) :: non_neg_integer()
Returns the number of events queued by a producer.
drain(server, throttle_state)
Specs
drain(GenStage.stage(), Shopify.GraphQL.Limiter.ThrottleState.t()) :: :ok
Begins the process of waiting for a shop's cost bucket to drain.
A drain will create a timer based on the minimum acceptable cost to unthrottle the producer. Once the timer ends the producer will be put in a restored state that will restart request processing.
Note that this function will not throttle the producer. It is expected that a producer will be in a throttled state before a drain is initiated.
draining?(server)
Specs
draining?(GenStage.stage()) :: boolean()
Returns whether the producer is currently waiting for a shop's cost bucket to drain.
idle?(server)
Specs
idle?(GenStage.stage()) :: boolean()
Determines whether a producer is in an idle state.
A producer is considered idle when it's queue length is 0.
name(parent, partition_id)
Specs
name(atom(), Shopify.GraphQL.Limiter.partition_id_t()) :: atom()
Returns the name of a Shopify.GraphQL.Limiter.Producer
process.
A producer process's name is a combination of the parent limiter's name
and a partition id. e.g. Shopify.GraphQL.Limiter.Producer:<partition_id>
.
process(server, operation, config)
Specs
process( GenStage.stage(), Shopify.GraphQL.Operation.t(), Shopify.GraphQL.Config.t() ) :: Shopify.GraphQL.response_t()
Synchronously processes a request.
restore(server)
Specs
restore(GenStage.stage()) :: :ok
Puts the producer in a restored state and restarts processing requests.
This function is typically called after a drain has completed.
retry(server, operation, config)
Specs
retry( GenStage.stage(), Shopify.GraphQL.Operation.t(), Shopify.GraphQL.Config.t() ) :: :ok
Adds a request to the front of the processing queue.
start_link(opts)
Specs
start_link(Keyword.t()) :: GenServer.on_start()
Starts a Shopify.GraphQL.Limiter.Producer
process and links it to the
supervision tree.
throttle(server)
Specs
throttle(GenStage.stage()) :: :ok
Stops the producer from fulfilling demand.
throttled?(server)
Specs
throttled?(GenStage.stage()) :: boolean()
Returns the throttle status.
unthrottle(server)
Specs
unthrottle(GenStage.stage()) :: :ok
Starts demand fulfillment.