Commit Graph

20 Commits

Author SHA1 Message Date
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 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 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 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 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 0c5e62a26a
Add the auctioneer bin stub 2019-12-30 07:32:34 -08:00