Class: Worldline::Connect::SDK::CallContext
- Inherits:
-
Object
- Object
- Worldline::Connect::SDK::CallContext
- Defined in:
- lib/worldline/connect/sdk/call_context.rb
Overview
A CallContext is used to identify requests and manage idempotent requests. A CallContext contains the following:
- idempotence_key
-
A randomly generated key used to identify requests
- idempotence_request_timestamp
-
If a previous request arrived with the same idempotence key, this value will be set to a timestamp of that request.
Instance Attribute Summary collapse
-
#idempotence_key ⇒ String
readonly
The idempotence key used to identify this request.
-
#idempotence_request_timestamp ⇒ Integer
If two or more requests arrive at the Worldline Global Collect platform with the same idempotence_key, the idempotence_request_timestamp will be set to the arrival time of the first of these requests.
Instance Method Summary collapse
-
#initialize(idempotence_key = nil) ⇒ CallContext
constructor
A new instance of CallContext.
Constructor Details
#initialize(idempotence_key = nil) ⇒ CallContext
Returns a new instance of CallContext.
20 21 22 |
# File 'lib/worldline/connect/sdk/call_context.rb', line 20 def initialize(idempotence_key = nil) @idempotence_key = idempotence_key end |
Instance Attribute Details
#idempotence_key ⇒ String (readonly)
The idempotence key used to identify this request. If two requests share the same idempotence_key, they are considered to be the same request and only the first request will be processed.
16 17 18 |
# File 'lib/worldline/connect/sdk/call_context.rb', line 16 def idempotence_key @idempotence_key end |
#idempotence_request_timestamp ⇒ Integer
If two or more requests arrive at the Worldline Global Collect platform with the same idempotence_key, the idempotence_request_timestamp will be set to the arrival time of the first of these requests.
16 17 18 |
# File 'lib/worldline/connect/sdk/call_context.rb', line 16 def @idempotence_request_timestamp end |