Hoogle Search
Within LTS Haskell 24.67 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
Abstract, parameterized interface to mutable Deques. An abstract interface to highly-parameterizable queues/deques. Background: There exists a feature space for queues that extends between:
- simple, single-ended, non-concurrent, bounded queues
- double-ended, threadsafe, growable queues
type
ConcDeque a = Deque Threadsafe Threadsafe DoubleEnd DoubleEnd Grow Safe aabstract-deque Data.Concurrent.Deque.Class A concurrent deque.
type family
Deque lThreaded rThreaded lDbl rDbl bnd safe eltabstract-deque Data.Concurrent.Deque.Class A family of Deques implementations. A concrete Deque implementation is selected based on the (phantom) type parameters, which encode several choices. For example, a work stealing deque is threadsafe only on one end and supports push/pop on one end (and pop-only) on the other:
> (Deque NT T D S Grow elt)
Note, however, that the above example is overconstraining in many situations. It demands an implementation which is NOT threadsafe on one end and does NOT support push on one end, whereas both these features would not hurt, if present. Thus when accepting a queue as input to a function you probably never want to overconstrain by demanding a less-featureful option. For example, rather than (Deque NT D T S Grow elt) You would probably want: (Deque nt D T s Grow elt)class
DequeClass (d :: Type -> Type)abstract-deque Data.Concurrent.Deque.Class Class encompassing the basic queue operations that hold for all single, 1.5, and double ended modes. We arbitrarily call the ends "left" and "right" and choose the natural operations to be pushing on the left and popping on the right.
type
WSDeque a = Deque Nonthreadsafe Threadsafe DoubleEnd SingleEnd Grow Safe aabstract-deque Data.Concurrent.Deque.Class Work-stealing deques (1.5 ended). Typically the worker pushes and pops its own queue (left) whereas thieves only pop (right).
data
DebugDeque (d :: Type -> Type) eltabstract-deque Data.Concurrent.Deque.Debugger Warning, this enforces the excessively STRONG invariant that if any end of the deque is non-threadsafe then it may ever only be touched by one thread during its entire lifetime. This extreme form of monagamy is easier to verify, because we don't have enough information to know if two operations on different threads are racing with one another or are properly synchronized. The wrapper data structure has two IORefs to track the last thread that touched the left and right end of the deque, respectively.
-
abstract-deque Data.Concurrent.Deque.Debugger No documentation available.
-
abstract-deque Data.Concurrent.Deque.Reference Stores a size bound (if any) as well as a mutable Seq.
module Data.Concurrent.Deque.Reference.
DequeInstance By convention, every provider of the Data.Concurrent.Deque.Class interface optionally provides a module that provides the relevant instances of the Deque type class, covering the [maximum] portion of the configuration space that the implementation is able to handle. This is kept in a separate package because importing instances is unconditional and the user may well want to assemble their own combination of Deque instances to cover the configuration space.
declareQueue :: Channel -> QueueOpts -> IO (Text, Int, Int)amqp Network.AMQP creates a new queue on the AMQP server; can be used like this: declareQueue channel newQueue {queueName = "myQueue"}. Returns a tuple (queue, messageCount, consumerCount). queue is the name of the new queue (if you don't specify a queue the server will autogenerate one). messageCount is the number of messages in the queue, which will be zero for newly-created queues. consumerCount is the number of active consumers for the queue.