-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add Rust to build process #420
Merged
+831
−2
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8377f7d
Add 'stroller' dir containing skeletal Rust web server
samstokes 16f3f6a
Add Rust stable to Docker image and build stroller
samstokes 5ff06e7
Rebuild stroller when source files change
samstokes 33314b8
Add Rust test run to build script
samstokes 696f994
fix perms after rebase
samstokes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
Have you given any thought to using async/await? No need to make a decision now -- but if you are I'm totally okay with pinning a nightly that we have to bump every couple of weeks to make that happen.
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've not looked into Rust's async/await much (although I'm familiar with similar features in other languages e.g. JS), so I don't have a strong opinion. Do you know what's the state of library support for async/await at the moment? It looks like Tokio's support is "experimental" and Hyper's is a WIP, but I'm not clear how much that's about improving the ergonomics vs just having it work at all.
That said, I'm not imagining that the initial scope of stroller will require much interesting control flow or concurrency handling - for now it's pretty much going to be "on an HTTP POST from the backend, send an event to Pusher, then log the result somewhere" - so we might not gain much from async/await at this stage.
Once we add direct websocket connections into the mix, that'll replace the middle step with "look up the right websocket connection and send an event to it", which isn't much more complex.
That said, both approaches have questions like "what happens if the client hasn't opened a Pusher channel / websocket connection yet", "what happens if we fail to push the event". We could have stroller implement store-and-forward in those cases, which would complicate the concurrency model. However, I suspect we won't want to do that, because there's one stroller per backend instance and we could get into a mess with duplicate or dropped pushes. Instead we may want to have some sort of less-frequent "catchup" poll for lost events, or always send the most recent events on websocket connection establishment, or similar. (Or maybe we don't care enough about occasional lost pushes to bother with any of that.)
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 had hoped tokio+hyper would be further along than when I last looked -- having given it a quick glance over I think swerving it for now is probably best.
Agreed with your thoughts re: initial scope.
For managing connections/store+forward/pusher replacement in the future, I'm imagining another service that stroller pushes to. Out of scope for now obvs, and I agree with punting on lost pushes/store+forward til then.