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

Improve network layer #34

Closed
6 tasks done
irongut opened this issue Dec 6, 2020 · 3 comments · Fixed by #40
Closed
6 tasks done

Improve network layer #34

irongut opened this issue Dec 6, 2020 · 3 comments · Fixed by #40
Assignees
Labels
BGS Background Simulation Demo Demo applications ED Status EDSM Elite: Dangerous Server Status API EDSM EDSM API enhancement New feature or request GalNet GalNet News Network Network Layer Powerplay Powerplay Tests Unit tests

Comments

@irongut
Copy link
Owner

irongut commented Dec 6, 2020

The current architecture forces the use of DownloadService which includes caching features but not all apps will require the cache.

  • Create an IDownloadService interface.
  • Rename the current DownloadService to CachedDownloadService.
  • Use constructor injection in API services to pass the required implementation.
  • Create a new DownloadService that does not implement caching. Include the connectivity check.
  • Use the new DownloadService in the demo app + tests.
  • Create tests for download services.
@irongut irongut added the enhancement New feature or request label Dec 6, 2020
@irongut irongut self-assigned this Dec 6, 2020
@irongut irongut added Network Network Layer Demo Demo applications Tests Unit tests BGS Background Simulation CGs INARA getCommunityGoals API ED Status EDSM Elite: Dangerous Server Status API EDSM EDSM API GalNet GalNet News Powerplay Powerplay labels Dec 6, 2020
@irongut irongut pinned this issue Jan 17, 2021
@irongut
Copy link
Owner Author

irongut commented Jan 17, 2021

StandingsService is too closely coupled to the original DownloadService and the cache implementation due to the way expiry is handled.

Do not include the GetData() overload that includes dataKey & updatedKey parameters in the IDownloadService interface.

A better solution that allows the use of any IDownloadService implementation should be found.

Spun out to its own issue - #41 Decouple StandingsService from CachedDownloadService.

@irongut
Copy link
Owner Author

irongut commented Jan 24, 2021

CachedDownloadService GetData() methods include expiry & ignoreCache parameters that make no sense for a non-cached download. But, the method signatures need to be the same for IDownloadService, CachedDownloadService and DownloadService.

Ideas:

  • Add expiry & ignoreCache parameters to Instance method.
  • Create a DownloadOptions structure / class that contains expiry, ignoreCache, cancelToken and any other relevant params. It can be passed to GetData() in all download service implementations.

irongut added a commit that referenced this issue Jan 25, 2021
irongut added a commit that referenced this issue Jan 25, 2021
@irongut
Copy link
Owner Author

irongut commented Jan 25, 2021

  • Add more constructors to DownloadOptions for situations where cancelToken isn't needed.

@irongut irongut unpinned this issue Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BGS Background Simulation Demo Demo applications ED Status EDSM Elite: Dangerous Server Status API EDSM EDSM API enhancement New feature or request GalNet GalNet News Network Network Layer Powerplay Powerplay Tests Unit tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant