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

Caching #27

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open

Caching #27

wants to merge 32 commits into from

Conversation

dmv1167
Copy link

@dmv1167 dmv1167 commented Sep 29, 2024

I have separated the caching mechanism I came up with into this branch. I understand if this isn't what you had in mind as the caches are stored with each object, and I'm willing to try to implement time based refreshing in some manner in the future.

athuler and others added 29 commits August 19, 2024 17:49
Added optional return types, removed None comparison with == and some redundant parentheses.
Began testing on live timing.
Added getStopById to Routes and Systems for use with live timing.
Vehicle getNextStop() and getEtas() use 3rd party API to get stops and times.
Stop getNextVehicle() and getEtas() gets vehicles and times.
@dmv1167
Copy link
Author

dmv1167 commented Oct 1, 2024

You may need to merge 0.3.0 into this branch as well

@dmv1167
Copy link
Author

dmv1167 commented Oct 3, 2024

That looked awfully messy but this PR should include 0.3.0 changes.

I made the caches into dictionaries to allow for instant lookups when using any getById() method. In the case of System, caches are automatically populated the first time the API is called, and still must be repopulated manually using refresh().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

2 participants