Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- data PCopy a
- pCopy :: Typeable a => a -> PCopy a
- matchP :: Typeable m => Match (Maybe m)
- matchChanP :: Typeable m => ReceivePort (PCopy m) -> Match m
- pUnwrap :: Typeable m => Message -> Process (Maybe m)
- data InputStream a = Null
- newInputStream :: forall a. Typeable a => Either (ReceivePort a) (STM a) -> InputStream a
- matchInputStream :: InputStream a -> Match a
- readInputStream :: Serializable a => InputStream a -> Process a
- data InvalidBinaryShim = InvalidBinaryShim
Copying non-serializable data
Instances
Generic (PCopy a) Source # | |
Typeable a => Binary (PCopy a) Source # | |
NFData a => NFData (PCopy a) Source # | |
type Rep (PCopy a) Source # | |
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-3PIUq7kIBoQKuBft1CeSET" '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 |
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.
data InvalidBinaryShim Source #
Constructors
InvalidBinaryShim |
Instances
Show InvalidBinaryShim Source # | |
Defined in Control.Distributed.Process.Extras.Internal.Unsafe Methods showsPrec :: Int -> InvalidBinaryShim -> ShowS # show :: InvalidBinaryShim -> String # showList :: [InvalidBinaryShim] -> ShowS # | |
Eq InvalidBinaryShim Source # | |
Defined in Control.Distributed.Process.Extras.Internal.Unsafe Methods (==) :: InvalidBinaryShim -> InvalidBinaryShim -> Bool # (/=) :: InvalidBinaryShim -> InvalidBinaryShim -> Bool # |