cdp-0.0.2.0: A library for the Chrome Devtools Protocol
Safe HaskellNone
LanguageHaskell2010

CDP.Runtime

Synopsis

Documentation

data SomeCommand where Source #

Constructors

SomeCommand :: Command cmd => cmd -> SomeCommand 

data CommandObj a Source #

Instances

Instances details
Show a => Show (CommandObj a) Source # 
Instance details

Defined in CDP.Runtime

ToJSON a => ToJSON (CommandObj a) Source # 
Instance details

Defined in CDP.Runtime

data Promise a where Source #

Constructors

Promise :: MVar tmp -> (tmp -> Either Error a) -> Promise a 

data IncomingMessage Source #

A message from the browser. We don't know yet if this is a command response or an event

Instances

Instances details
FromJSON IncomingMessage Source # 
Instance details

Defined in CDP.Runtime

type ClientApp b = Handle -> IO b Source #

runClient :: forall b. Config -> ClientApp b -> IO b Source #

Runs a client application. By default, the connection is made to the browser. See the path field in Config. The connection is closed once the IO action completes

subscribe :: forall a. Event a => Handle -> (a -> IO ()) -> IO Subscription Source #

Subscribes to an event

subscribeForSession :: forall a. Event a => Handle -> SessionId -> (a -> IO ()) -> IO Subscription Source #

Subscribes to an event for a given session

subscribe_ :: forall a. Event a => Handle -> Maybe SessionId -> (a -> IO ()) -> IO Subscription Source #

unsubscribe :: Handle -> Subscription -> IO () Source #

Unsubscribes to an event

readPromise :: Promise a -> IO a Source #

Resolves a promise to its value

sendCommandWait :: Command cmd => Handle -> cmd -> IO (CommandResponse cmd) Source #

Sends a command to the browser and waits until a response is received, for the timeout duration configured

sendCommandForSessionWait :: Command cmd => Handle -> SessionId -> cmd -> IO (CommandResponse cmd) Source #

Sends a command to the browser for a given session and waits until a response is received, for the timeout duration configured

sendCommand :: forall cmd. Command cmd => Handle -> cmd -> IO (Promise (CommandResponse cmd)) Source #

Sends a command to the browser

sendCommandForSession :: forall cmd. Command cmd => Handle -> SessionId -> cmd -> IO (Promise (CommandResponse cmd)) Source #

Sends a command to the browser for a given session

sendCommand_ :: forall cmd. Command cmd => Handle -> Maybe SessionId -> cmd -> IO (Promise (CommandResponse cmd)) Source #

fromSomeCommand :: (forall cmd. Command cmd => cmd -> r) -> SomeCommand -> r Source #