distributed-process-extras-0.3.9: Cloud Haskell Extras
Safe HaskellNone
LanguageHaskell2010

Control.Distributed.Process.Extras.Internal.Unsafe

Description

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.

Synopsis

Copying non-serializable data

data PCopy a Source #

Instances

Instances details
Generic (PCopy a) Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Unsafe

Associated Types

type Rep (PCopy a) 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Unsafe

type Rep (PCopy a) = D1 ('MetaData "PCopy" "Control.Distributed.Process.Extras.Internal.Unsafe" "distributed-process-extras-0.3.9-JrK528Ft3UjFf9OZ4oXsAv" 'False) (C1 ('MetaCons "PCopy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))

Methods

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

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

Typeable a => Binary (PCopy a) Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Unsafe

Methods

put :: PCopy a -> Put #

get :: Get (PCopy a) #

putList :: [PCopy a] -> Put #

NFData a => NFData (PCopy a) Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Unsafe

Methods

rnf :: PCopy a -> () #

type Rep (PCopy a) Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Unsafe

type Rep (PCopy a) = D1 ('MetaData "PCopy" "Control.Distributed.Process.Extras.Internal.Unsafe" "distributed-process-extras-0.3.9-JrK528Ft3UjFf9OZ4oXsAv" 'False) (C1 ('MetaCons "PCopy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe 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.

Constructors

Null 

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.