Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Use
RetryPolicy
to keep SignalR connection alive and replaceList<RealtimeData>
withImmutableList<RealtimeData>
#24Use
RetryPolicy
to keep SignalR connection alive and replaceList<RealtimeData>
withImmutableList<RealtimeData>
#24Changes from 3 commits
4bc969b
b7dd493
16ad0af
62b82dd
64ef78d
f4f67c8
e206721
dcec5d1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Worried that this condition will always be met when the headways are really large... it may be fine. Need to double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you make this method async you could await CreateHubConnections and just return freshData (rather than needing to wrap it in a task).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think once I deal with the concurrency issue of
CreateHubConnections
I'll avoid calling.Wait()
so this function can return immediately.Currently there are 2 potential issues:
This check is not reliable as without lock another thread can substitute the connection with a new one and the condition will still return true.
Another thread might be able to run between
.ToArray()
and.Clear()
such that it will try to dispose the connections again.The goal is to make sure once an
HubConnection
instance is retrieved from dictionary it remain exclusive to the thread until being put back(or not), maybeTryRemove
will do.Once refactor is done we should be able to reconnect a single
HubConnection
for more fine-grained control, if staled data is detected for the(Station, RouteDirection)
pair.Check warning on line 117 in server/PathServices/SignalRRealtimeDataRepository.cs
GitHub Actions / build
Check warning on line 117 in server/PathServices/SignalRRealtimeDataRepository.cs
GitHub Actions / build