Commit Graph

153 Commits

Author SHA1 Message Date
R Tyler Croy 58cdae28cc
Prototype the travis-ci processor pushing directly into the tasks.for_auction channel
This doesn't help too terribly much at this point, but at least it's a means of
getting a .travis-ci.yml into the system
2020-01-13 19:41:07 -08:00
R Tyler Croy 51057413e3
Implement a simple processor for travis-ci.yml files
Currently this emits data only to standard out, but it will likely need to learn
how to drop this payload directly onto the eventbus in the near future
2020-01-13 18:19:54 -08:00
R Tyler Croy 3ebcf376c6
Starting to scope out a simple Travis CI processor
I need something to generate some simple tasks to pump into the eventbus for the
auctioneer, this will have to do
2020-01-12 14:23:37 -08:00
R Tyler Croy b40abcad9d
Implement backoff on connection errors for the eventbus client
This uses a fibonacci backoff (yay I pass the coding interview) for attempting
to reconnect the connection if something cannot work properly
2020-01-11 20:44:05 -08:00
R Tyler Croy 24db3be3ea
Refactor the EventBusClient code into the eventus crate where it belongs
Now that I have something simple and functioning, this no longer needs to be
in the auctioneer

The fun work begins now, supporting custom messages known only to the auctioneer
for its needs, but passing those through EventBusClient
2020-01-11 16:18:14 -08:00
R Tyler Croy 0f3582db01
Implement the Default trait for Meta to make it easier for the auctioneer
This removes a dependency from auctioneer and is the first step in refactoring
the EventBusClient into the eventbus crate
2020-01-11 16:18:14 -08:00
R Tyler Croy e0a9b0c870
Implement some basic command dispatching in the auctioneer
This code will soon be refactored into the eventbus crate so that all other
clients can implement their handlers the same way
2020-01-11 13:03:37 -08:00
R Tyler Croy 044abc397f
Deserialize messages from the eventbus 2020-01-11 12:38:35 -08:00
R Tyler Croy b1260df2cf
Switch back to actix-web-actors for the eventbus client, again. >_<
I originally tossed this approach since I believed that the awc +
actix-web-actors approach was unnecessarily complex. After experimenting a bit
with tungstenite, I believe that converting its high-level API into something
that I could work with in an asynchronous manner would require too much poking
around with tokio to be worth the effort.

I suppose I'll have to make do with the somewhat mid-level abstraction that
actix-web-actors provides me.
2020-01-11 12:38:34 -08:00
R Tyler Croy eb75d61259
cargo fmt 2020-01-11 12:38:33 -08:00
R Tyler Croy 9b1df700de
Clean up a little bit of error handling in the eventbus CLI 2020-01-11 11:17:58 -08:00
R Tyler Croy a5ae7e15a8
Begin working on the per-client inbox functionality
There's some refactoring I need to do in the server/eventbus module before
continuing, but this contains the initial cut of code necessary to create a new
inbox when a client connects that will map to that client name
2020-01-11 11:17:56 -08:00
R Tyler Croy 4e07844097
Add RFC 5 to the README 2020-01-07 21:46:09 -08:00
R Tyler Croy 44a8290e2a
Merge remote-tracking branch 'github/master' 2020-01-07 21:43:44 -08:00
R Tyler Croy ac1a78469b
Add an RFC describing the decision to use JSON over HTTP for the data format and transport 2020-01-07 21:43:16 -08:00
R Tyler Croy ebe21dfd6f
Update the readme a bit to make it more clear where things are. 2020-01-06 18:39:32 -08:00
R Tyler Croy a2a0bf94f7
Update the eventbus README to include some more details about what it does.
This also includes the current working API
2020-01-05 18:46:55 -08:00
R Tyler Croy ebf85ce3c1
Merge pull request #26 from johndotpub/patch-1
Update README.adoc
2020-01-05 18:02:55 -08:00
John deb439ea13
Update README.adoc
Fixing the tiniest of typos.
2020-01-05 17:54:01 -08:00
R Tyler Croy 17d3b07b7f Merge branch 'resource-allocation' of rtyler/otto into master 2020-01-05 14:12:37 -08:00
R Tyler Croy 8d49aded94
Add a simple test for the eventbus index route 2020-01-05 14:09:45 -08:00
R Tyler Croy 6a1f3636c8
Add a custom .cargo/config to improve the link performance a bit
Thanks to the folks in ##rust on Freenode for helping tinker around with this
😸
2020-01-05 14:01:37 -08:00
R Tyler Croy e67165f10b
Introduce rustyline for the eventbus CLI 2020-01-04 22:39:05 -08:00
R Tyler Croy c3d3327741
Support publishing events to the eventbus
This actually works! 👏 Of course, all clients can publish to any channel,
but pish posh, who needs authorization 😸
2020-01-04 22:17:06 -08:00
R Tyler Croy 22d8c60b74
Adjust the handling of the inputs to properly deserialize messages
This makes sure that clients can actually send requests
2020-01-04 22:17:06 -08:00
R Tyler Croy 57722f9489
Avoid Arc::try_unwrap which causes a panic when multiple clients are connected 2020-01-04 22:17:06 -08:00
R Tyler Croy 8d520a156d
Add a simple eventbus CLI for testing 2020-01-04 22:17:05 -08:00
R Tyler Croy f347234c05
Properly handle server disconnects in the auctioneer
This at least ensures that we're reconnecting and can continue to receive
messages when the server disappears
2020-01-04 22:17:05 -08:00
R Tyler Croy 02743a185f
Serialize fully usable input and output messages for the eventbus
While connecting the auctioneer, I noticed that the messages need to have their
channel name associated with the message body, otherwise the client doesn't know
what message goes where!
2020-01-03 14:09:04 -08:00
R Tyler Croy 2d0ac296d9
Restructure the messages for the eventbus into Inputs and Outputs 2020-01-03 14:09:04 -08:00
R Tyler Croy 8cdf1ca0da
Remove awc, which has kind of a crappy interface for consuming websockets 2020-01-03 14:09:04 -08:00
R Tyler Croy c3b5010cab
Tidy up some Cargo.tomls 2020-01-03 12:30:46 -08:00
R Tyler Croy 88dce8da57
Add "no current timer" panic workaround code.
Still not clear why the previous iteration failed  but this succeeds.
2020-01-01 11:50:45 -08:00
R Tyler Croy b162e53402
Full import of the actix websocket example
This fails with a "no current timer" panic

Referenced: https://github.com/actix/examples/issues/213

Potentially fixed with: https://github.com/actix/examples/pull/166
2020-01-01 11:46:27 -08:00
R Tyler Croy 5c20440335
interpolate-folder-path for rust-embed in the eventbus
This will ensure that the routes will worker properly in `cargo test` and `cargo
run`
2020-01-01 10:57:40 -08:00
R Tyler Croy 26ce64c7a4
Revert "Checkpoint some experimenting with using bastion/tide/tungstenite"
This reverts commit 399c17d161.
2020-01-01 10:51:49 -08:00
R Tyler Croy 399c17d161
Checkpoint some experimenting with using bastion/tide/tungstenite
I think I am going to have to abandon this approach for a couple of different
reasons:

 * Bastion does not yet support dynamic supervision
   <https://github.com/bastion-rs/bastion/issues/9>
   This means that any workers which might handle websocket or other connections
   cannot possibly scale because the server would need to start with a fixed number
   of children under supervision. Contrary to what we have with actix-web where
   we use an actor per connection.

 * Tide/tungstenite do not yet integrate. It seems that actix-web and _maybe_
   gotham are the only two web frameworks which properly upgrade HTTP
   connections to websockets without requiring two fundamentally different servers
   to be running.
2020-01-01 10:50:58 -08:00
R Tyler Croy 9b82154d01
Pick up some development changes for bastion 2020-01-01 10:50:57 -08:00
R Tyler Croy c93648a172
Chain everything off the same supervisor to have a consistent strategy 2020-01-01 10:50:57 -08:00
R Tyler Croy fcda970ddd
Play around with workers handling messages in the auctioneer
This seems to spin in a sched_yield loop, which I think is the ctx.recv().await?
2019-12-30 17:10:43 -08:00
R Tyler Croy 39949fc5b9
Introduce bastion supervision to the websockets client for the auctioneer
This makes the auctioneer resilient to total failures on connecting to the
eventbus, but unfortunately spins in a tight loop if the eventbus is offline.
2019-12-30 14:24:02 -08:00
R Tyler Croy 4020eeb818
Drop actix-web in favor of raw tungstenite for the auctioneer ws client
This is just experimental at the moment.
2019-12-30 14:05:21 -08:00
R Tyler Croy ee4aa60618
Refactor the eventbus crate a bit to allow for client and server separation
This should make it a bit easier to incorporate the necessary client code that
all other services will want to import
2019-12-30 08:14:00 -08:00
R Tyler Croy 950fec403a
Import the actix-websocket example client code.
This is just to checkpoint this work. I think I'll be refactoring the eventbus
quite a bit to make sure that each eventbus client doesn't need to do too much
custom actix work
2019-12-30 08:03:07 -08:00
R Tyler Croy 74feb6172a
Add a simple Procfile for running the eventbus and auctioneer together 2019-12-30 07:42:19 -08:00
R Tyler Croy ba534c36c9
Import the MIT-licensed shoreman
shoreman is a shell-only implementation of the Ruby "foreman" gem, which is
helpful for running multiple processes locally for development.

https://github.com/chrismytton/shoreman
2019-12-30 07:40:48 -08:00
R Tyler Croy 0c5e62a26a
Add the auctioneer bin stub 2019-12-30 07:32:34 -08:00
R Tyler Croy 22d273aa97
Add the default channels as described in RFC 0003 2019-12-30 07:30:06 -08:00
R Tyler Croy 0d11b64a9b
Tweak these links to render properly on GitHub
🙀
2019-12-29 13:02:08 -08:00
R Tyler Croy 2542e2ed6a
Link the RFCs from the README 2019-12-29 13:00:33 -08:00