algesten / str0m

A synchronous sans I/O WebRTC implementation in Rust.
MIT License
280 stars 45 forks source link

Provide reason for Output::Timeout #520

Closed algesten closed 1 month ago

algesten commented 1 month ago

This is by suggestion from @xnorpx.

algesten commented 1 month ago

My one concern is that it's a breaking change for the API, and maybe details that a new user of str0m might not need.

I'm weighing this API vs adding a Rtc::last_timeout_reason(), leaving the API as is, and giving us an API if we want to know the reason.

davibe commented 1 month ago

Rtc::last_timeout_reason()

like

algesten commented 1 month ago

Alright. Pushed the alternative API. Also fixed some timeouts that should have returned None.

xnorpx commented 1 month ago

Tested it seems to be working:

2024-05-25T15:51:07.036296Z ERROR something: Ice, Instant { tv_sec: 12329, tv_nsec: 182128520, } 2024-05-25T15:51:09.489807Z ERROR something: Stats, Instant { tv_sec: 12331, tv_nsec: 636220215, }

I like this change, it's easy for us to pull it if we want the information but doesn't brake the current API.

LGTM!