distributed-process-extras-0.3.5: Cloud Haskell Extras

Safe HaskellNone




If you don't know exactly what this module is for and precisely how to use the types within, you should move on, quickly!

Implementation Notes
This module provides facilities for forcibly sending non-serializable data via cloud haskell's messaging primitives, such as send et al. Of course, if you attmept to do this when interacting with a remote process, your application will break.

NB: this module will be deprecated in the next dot release, pending rewrite of the libraries that currently rely on it, to use the new supporting APIs for STM interactions in distributed-process-client-server.


Copying non-serializable data

data PCopy a Source #


Generic (PCopy a) Source # 

Associated Types

type Rep (PCopy a) :: * -> * #


from :: PCopy a -> Rep (PCopy a) x #

to :: Rep (PCopy a) x -> PCopy a #

Typeable * a => Binary (PCopy a) Source # 


put :: PCopy a -> Put #

get :: Get (PCopy a) #

putList :: [PCopy a] -> Put #

NFData a => NFData (PCopy a) Source # 


rnf :: PCopy a -> () #

type Rep (PCopy a) Source # 
type Rep (PCopy a) = D1 * (MetaData "PCopy" "Control.Distributed.Process.Extras.Internal.Unsafe" "distributed-process-extras-0.3.5-7qzKH0dWmcLBNm6JMkdrjz" False) (C1 * (MetaCons "PCopy" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * a)))

pCopy :: Typeable a => a -> PCopy a Source #

Wrap any Typeable datum in a PCopy. We hide the constructor to discourage arbitrary uses of the type, since PCopy is a specialised and potentially dangerous construct.

matchP :: Typeable m => Match (Maybe m) Source #

Matches on PCopy m and returns the m within. This potentially allows us to bypass serialization (and the type constraints it enforces) for local message passing (i.e., with UnencodedMessage data), since PCopy is just a shim.

matchChanP :: Typeable m => ReceivePort (PCopy m) -> Match m Source #

Matches on a TypedChannel (PCopy a).

pUnwrap :: Typeable m => Message -> Process (Maybe m) Source #

Given a raw Message, attempt to unwrap a Typeable datum from an enclosing PCopy wrapper.

Arbitrary (unmanaged) message streams

data InputStream a Source #

A generic input channel that can be read from in the same fashion as a typed channel (i.e., ReceivePort). To read from an input stream in isolation, see readInputStream. To compose an InputStream with reads on a process' mailbox (and/or typed channels), see matchInputStream.



newInputStream :: forall a. Typeable a => Either (ReceivePort a) (STM a) -> InputStream a Source #

Create a new InputStream.

matchInputStream :: InputStream a -> Match a Source #

Constructs a Match for a given InputChannel.

readInputStream :: Serializable a => InputStream a -> Process a Source #

Read from an InputStream. This is a blocking operation.