aiorocket2.utils

additional functions used by aiorocket2

Functions

backoff_sleep(attempt, base)

Sleep using exponential backoff for the given attempt number (0-based).

generate_idempotency_id()

Generate a simple idempotency identifier based on the current timestamp.

gii()

Generate a simple idempotency identifier based on the current timestamp.

async aiorocket2.utils.backoff_sleep(attempt, base)[source]

Sleep using exponential backoff for the given attempt number (0-based).

Parameters:
  • attempt (int)

  • base (float)

Return type:

None

aiorocket2.utils.generate_idempotency_id()[source]

Generate a simple idempotency identifier based on the current timestamp.

The xRocket Pay API accepts transferId / withdrawalId for idempotency.

Return type:

str

aiorocket2.utils.gii()

Generate a simple idempotency identifier based on the current timestamp.

The xRocket Pay API accepts transferId / withdrawalId for idempotency.

Return type:

str