Skip to content

Commit

Permalink
Merge pull request #1231 from sdroege/0.18-deprecate-main-context-cha…
Browse files Browse the repository at this point in the history
…nnel

glib: Deprecate main context channel
  • Loading branch information
sdroege authored Nov 25, 2023
2 parents e6192fe + 9a8b40f commit 93f6a02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions glib/src/main_context_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ impl MainContext {
/// will fail.
///
/// The returned `Sender` behaves the same as `std::sync::mpsc::Sender`.
#[deprecated = "Use an async channel on the main context instead"]
pub fn channel<T>(priority: Priority) -> (Sender<T>, Receiver<T>) {
let channel = Channel::new(None);
let receiver = Receiver(Some(channel.clone()), priority);
Expand All @@ -562,6 +563,7 @@ impl MainContext {
/// will fail.
///
/// The returned `SyncSender` behaves the same as `std::sync::mpsc::SyncSender`.
#[deprecated = "Use an async channel on the main context instead"]
pub fn sync_channel<T>(priority: Priority, bound: usize) -> (SyncSender<T>, Receiver<T>) {
let channel = Channel::new(Some(bound));
let receiver = Receiver(Some(channel.clone()), priority);
Expand All @@ -572,6 +574,7 @@ impl MainContext {
}

#[cfg(test)]
#[allow(deprecated)]
mod tests {
use std::{
cell::RefCell,
Expand Down

0 comments on commit 93f6a02

Please sign in to comment.