Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions asyncband/src/channel/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

#[cfg(feature = "mpsc")]
pub mod mpsc;
#[cfg(feature = "oneshot")]
pub mod oneshot;
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ use std::sync::atomic::Ordering;
use std::task::Context;
use std::task::Poll;

use super::RecvError;
use super::SendError;
use super::TryRecvError;
use super::TrySendError;
use crate::internal::atomic_waker::AtomicWaker;
use crate::internal::semaphore::Acquire;
use crate::internal::semaphore::Semaphore;
use crate::mpsc::RecvError;
use crate::mpsc::SendError;
use crate::mpsc::TryRecvError;
use crate::mpsc::error::TrySendError;

/// Creates a bounded mpsc channel for communicating between asynchronous
/// tasks with backpressure.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ use std::sync::atomic::Ordering;
use std::task::Context;
use std::task::Poll;

use super::RecvError;
use super::SendError;
use super::TryRecvError;
use crate::internal::atomic_waker::AtomicWaker;
use crate::mpsc::RecvError;
use crate::mpsc::SendError;
use crate::mpsc::TryRecvError;

/// Creates an unbounded mpsc channel for communicating between asynchronous
/// tasks without backpressure.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ use std::sync::atomic::fence;
use std::task::Context;
use std::task::Poll;

use crate::oneshot::AWAKING;
use crate::oneshot::Channel;
use crate::oneshot::DISCONNECTED;
use crate::oneshot::EMPTY;
use crate::oneshot::MESSAGE;
use crate::oneshot::RECEIVING;
use super::AWAKING;
use super::Channel;
use super::DISCONNECTED;
use super::EMPTY;
use super::MESSAGE;
use super::RECEIVING;
#[cfg(doc)]
use crate::oneshot::Sender;
use crate::oneshot::deallocate_empty_channel;
use crate::oneshot::drop_message_and_deallocate_channel;
use super::Sender;
use super::deallocate_empty_channel;
use super::drop_message_and_deallocate_channel;

/// Receives a value from the associated [`Sender`].
pub struct Receiver<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ use std::ptr::NonNull;
use std::sync::atomic::Ordering;
use std::sync::atomic::fence;

use crate::oneshot::Channel;
use crate::oneshot::DISCONNECTED;
use crate::oneshot::EMPTY;
use crate::oneshot::MESSAGE;
use crate::oneshot::RECEIVING;
use super::Channel;
use super::DISCONNECTED;
use super::EMPTY;
use super::MESSAGE;
use super::RECEIVING;
#[cfg(doc)]
use crate::oneshot::Receiver;
use crate::oneshot::deallocate_empty_channel;
use crate::oneshot::drop_message_and_deallocate_channel;
use super::Receiver;
use super::deallocate_empty_channel;
use super::drop_message_and_deallocate_channel;

/// Sends a value to the associated [`Receiver`].
pub struct Sender<T> {
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions asyncband/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
//!
//! While incubation status is not necessarily a reflection of the completeness or stability of the
//! code, it does indicate that the project has yet to be fully endorsed by the ASF.
mod channel;
mod internal;

#[cfg(feature = "barrier")]
Expand All @@ -111,7 +112,7 @@ pub mod condvar;
#[cfg(feature = "latch")]
pub mod latch;
#[cfg(feature = "mpsc")]
pub mod mpsc;
pub use self::channel::mpsc;
#[cfg(feature = "mutex")]
pub mod mutex;
#[cfg(any(
Expand All @@ -122,7 +123,7 @@ pub mod mutex;
))]
pub mod once;
#[cfg(feature = "oneshot")]
pub mod oneshot;
pub use self::channel::oneshot;
#[cfg(feature = "pool")]
pub mod pool;
#[cfg(feature = "rwlock")]
Expand Down