- 🔄 Asynchronous Request Queue - Built-in priority queue system for handling concurrent API requests
- 🔍 X (Twitter) Integration - Comprehensive search and profile data retrieval
- ⚡ Rate Limiting - Intelligent rate limiting and retry mechanisms
- 🛡️ Error Handling - Robust error handling with custom error types
- 📊 Response Management - Channel-based response handling for async operations
go get github.com/masa-finance/masa-sdk-go
queue := x.NewRequestQueue(5) // 5 concurrent workers
queue.Start()
defer queue.Stop()
responseChan := queue.AddRequest(x.SearchRequest, map[string]interface{}{
"query": "web3",
"count": 10,
"additionalProps": map[string]interface{}{
"fromDate": "2024-01-01",
"toDate": "2024-03-20",
},
}, x.DefaultPriority)
response := <-responseChan
responseChan := queue.AddRequest(x.ProfileRequest, map[string]interface{}{
"username": "elonmusk",
}, x.DefaultPriority)
response := <-responseChan
Parameter | Default | Description |
---|---|---|
MaxConcurrentRequests | 5 | Maximum number of concurrent workers |
APIRequestsPerSecond | 20 | Rate limit for API requests |
DefaultRetries | 10 | Number of retry attempts |
DefaultPriority | 100 | Default priority for requests |
The SDK provides custom error types for different scenarios:
- RateLimitError
- WorkerRateLimitError
- TimeoutError
- ConnectionError
- EmptyResponseError
ginkgo tests/integration/x/... -v
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.