Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Async Functions for API Requests #2

Open
5 tasks
AbdoAnss opened this issue Dec 11, 2024 · 0 comments
Open
5 tasks

Implement Async Functions for API Requests #2

AbdoAnss opened this issue Dec 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@AbdoAnss
Copy link
Owner

AbdoAnss commented Dec 11, 2024

Add support for asynchronous operations to improve performance when fetching multiple resources.

Overview

Currently, all API requests are synchronous which can lead to slower performance when fetching multiple resources (players, teams, fixtures etc.). We should implement async versions of key functions to allow concurrent requests.

Proposed Changes

  • Add async versions of main service methods
  • Implement proper error handling for concurrent requests
  • Add rate limiting protection for parallel requests
  • Create helper functions for batch operations

Functions to Update

  • GetAllPlayers()
  • GetPlayerHistory()
  • GetAllFixtures()
  • GetAllTeams()
  • ... etc

Implementation Details

  • Use Go routines and channels for concurrent operations
  • Implement context support for cancellation
  • Maintain existing rate limiting while supporting parallel requests

Success Criteria

  • Async versions of key methods implemented
  • Proper error handling
  • Rate limiting respected
  • Tests added for async functions
  • Documentation updated

Related

  • Rate limiting implementation
  • Error handling patterns
@AbdoAnss AbdoAnss added the enhancement New feature or request label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant