relay connected!

This commit is contained in:
William Casarin
2022-12-11 17:09:44 -08:00
parent e6571d8847
commit 5619ae60ad
12 changed files with 266 additions and 53 deletions

View File

@@ -46,9 +46,9 @@ impl PartialEq for Relay {
impl Eq for Relay {}
impl Relay {
pub fn new(url: String) -> Result<Self> {
pub fn new(url: String, wakeup: impl Fn() + Send + Sync + 'static) -> Result<Self> {
let status = RelayStatus::Connecting;
let (sender, receiver) = ewebsock::connect(&url)?;
let (sender, receiver) = ewebsock::connect_with_wakeup(&url, wakeup)?;
Ok(Self {
url,