Skip to content

v0.1.2 - Timeout Parameter Support

Choose a tag to compare

@github-actions github-actions released this 20 Nov 03:40
· 63 commits to master since this release

🎉 New Features

Timeout Parameter Support

Added customizable timeout parameter for API queries, giving users more control over query behavior.

Features:

  • Set default timeout during initialization (default: 5000ms)
  • Override timeout for individual list_positions() calls
  • All API calls respect the specified timeout value

Usage:

# Method 1: Set default timeout during initialization
sync = PositionSync(api, sync_threshold=30, timeout=10000)  # 10 seconds

# Method 2: Override timeout for specific query
positions = sync.list_positions(timeout=3000)  # 3 seconds

# Method 3: Use default timeout
positions = sync.list_positions()  # Uses initialization default

📚 Documentation

📦 Installation

pip install sj-sync==0.1.2

Or with uv:

uv add sj-sync==0.1.2

🔗 Links


🎉 新增功能

Timeout 參數支援

新增可自訂的 timeout 參數,讓使用者可以更靈活地控制 API 查詢行為。

功能:

  • 在初始化時設定預設 timeout(預設:5000 毫秒)
  • 在 list_positions() 呼叫時可覆寫 timeout
  • 所有 API 呼叫都會使用指定的 timeout 值

使用方式:

# 方式 1:初始化時設定預設 timeout
sync = PositionSync(api, sync_threshold=30, timeout=10000)  # 10 秒

# 方式 2:覆寫特定查詢的 timeout
positions = sync.list_positions(timeout=3000)  # 3 秒

# 方式 3:使用預設 timeout
positions = sync.list_positions()  # 使用初始化時的預設值

📚 文件

📦 安裝

pip install sj-sync==0.1.2

或使用 uv:

uv add sj-sync==0.1.2

🔗 相關連結


Full Changelog: v0.1.1...v0.1.2