Class: Restate::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/restate/config.rb

Overview

Global SDK configuration. Set via Restate.configure.

Examples:

Restate.configure do |c|
  c.ingress_url = "http://localhost:8080"
  c.admin_url   = "http://localhost:9070"
end

# Then use the pre-configured client:
Restate.client.service(Greeter).greet("World")

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



39
40
41
42
43
44
# File 'lib/restate/config.rb', line 39

def initialize
  @ingress_url = 'http://localhost:8080'
  @admin_url = 'http://localhost:9070'
  @ingress_headers = {}
  @admin_headers = {}
end

Instance Attribute Details

#admin_headersObject

Default headers sent with every admin request. Accepts the same static Hash or callable forms as ingress_headers.



37
38
39
# File 'lib/restate/config.rb', line 37

def admin_headers
  @admin_headers
end

#admin_urlObject

Restate admin URL (for deployments, invocation management).



20
21
22
# File 'lib/restate/config.rb', line 20

def admin_url
  @admin_url
end

#ingress_headersObject

Default headers sent with every ingress request. Can be a Hash or a callable (Proc/Lambda) returning a Hash. A callable is evaluated each time Restate.client is called, which lets frameworks like Rails inject per-request context (e.g., team ID, shard routing, auth tokens).

Examples:

Static headers

config.ingress_headers = { "Authorization" => "Bearer tok" }

Dynamic headers

config.ingress_headers = -> { { "X-Team-Id" => Current.team_id } }


33
34
35
# File 'lib/restate/config.rb', line 33

def ingress_headers
  @ingress_headers
end

#ingress_urlObject

Restate ingress URL (for invoking services).



17
18
19
# File 'lib/restate/config.rb', line 17

def ingress_url
  @ingress_url
end