Sha256: 1b91eefa3b886db1e9d7923d6caaa942ee179bebf0fdbc6c3c8774449531bf40

Contents?: true

Size: 795 Bytes

Versions: 5

Compression:

Stored size: 795 Bytes

Contents

module FaaStRuby
  class Response
    def self.request_limit_reached(workspace: nil, function: nil)
      body = {'error' => "Concurrent requests limit reached. Please add more runners to the workspace #{workspace}."} if workspace
      # body = {'error' => "Concurrent requests limit reached for function '#{workspace}/#{function}'. Please associate more runners."} if function
      body = Oj.dump(body)
      new(
        body: body,
        status: 422,
        headers: {'Content-Type' => 'application/json'}
      )
    end
    attr_accessor :body, :status, :headers, :binary
    def initialize(body:, status: 200, headers: {}, binary: false)
      @body = body
      @status = status
      @headers = headers
      @binary = binary
    end

    def binary?
      @binary
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
faastruby-0.4.18 lib/faastruby/server/response.rb
faastruby-0.4.17 lib/faastruby/server/response.rb
faastruby-0.4.16 lib/faastruby/server/response.rb
faastruby-0.4.15 lib/faastruby/server/response.rb
faastruby-0.4.14 lib/faastruby/server/response.rb