Copyright | (c) Sebastian Witte |
---|---|
License | Apache-2.0 |
Maintainer | woozletoff@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data RPCConfig = RPCConfig {}
- newRPCConfig :: (Applicative io, MonadUnliftIO io) => io RPCConfig
- data SocketType
- createHandle :: (Functor io, MonadUnliftIO io) => SocketType -> io Handle
- parseNvimEnvironmentVariable :: MonadFail m => String -> m SocketType
- pUnixSocket :: Parser SocketType
- pTcpAddress :: Parser SocketType
- cleanUpHandle :: MonadUnliftIO io => Handle -> Bool -> io ()
Documentation
Things shared between the socket reader and the event handler.
RPCConfig | |
|
newRPCConfig :: (Applicative io, MonadUnliftIO io) => io RPCConfig Source #
Create a new basic configuration containing a communication channel for remote procedure call events and an empty lookup table for functions to mediate.
data SocketType Source #
Simple data type defining the kind of socket the socket reader should use.
Stdout Handle | Use the handle for receiving msgpack-rpc messages. This is suitable for an embedded neovim which is used in test cases. |
Environment | Read the connection information from the environment
variable |
UnixSocket FilePath | Use a unix socket. |
TCP Int String | Use an IP socket. First argument is the port and the second is the host name. |
createHandle :: (Functor io, MonadUnliftIO io) => SocketType -> io Handle Source #
Create a Handle
from the given socket description.
The handle is not automatically closed.
parseNvimEnvironmentVariable :: MonadFail m => String -> m SocketType Source #
cleanUpHandle :: MonadUnliftIO io => Handle -> Bool -> io () Source #
Close the handle and print a warning if the conduit chain has been interrupted prematurely.