shopify_graphql v1.4.0 Shopify.GraphQL.Limiter.Producer
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
Returns the number of events queued by a producer.
drain(server, throttle_state)
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.
Returns whether the producer is currently waiting for a shop's cost bucket to drain.
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)
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)
process( GenStage.stage(), Shopify.GraphQL.Operation.t(), Shopify.GraphQL.Config.t() ) :: Shopify.GraphQL.response_t()
Synchronously processes a request.
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)
retry( GenStage.stage(), Shopify.GraphQL.Operation.t(), Shopify.GraphQL.Config.t() ) :: :ok
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.