| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
System.Semaphore.Internal.Version
Description
Semaphore protocol version and versioned semaphore identifiers.
Synopsis
- data SemaphoreName = SemaphoreName {}
- type SemaphoreIdentifier = String
- newtype SemaphoreProtocolVersion = SemaphoreProtocolVersion {}
- data SemaphoreError
- = SemaphoreAlreadyExists { }
- | SemaphoreDoesNotExist { }
- | SemaphoreIncompatibleVersion { }
- | SemaphoreOtherError { }
- semaphoreVersion :: SemaphoreProtocolVersion
- semaphoreIdentifier :: SemaphoreName -> SemaphoreIdentifier
- parseSemaphoreIdentifier :: SemaphoreIdentifier -> Maybe SemaphoreName
- getSemaphoreSocketPath :: SemaphoreName -> IO FilePath
- iToBase62 :: Int -> String
Documentation
data SemaphoreName Source #
A semaphore name: a protocol version and an unversioned name string.
Constructors
| SemaphoreName | |
Instances
| Show SemaphoreName Source # | |
Defined in System.Semaphore.Internal.Version Methods showsPrec :: Int -> SemaphoreName -> ShowS # show :: SemaphoreName -> String # showList :: [SemaphoreName] -> ShowS # | |
| Eq SemaphoreName Source # | |
Defined in System.Semaphore.Internal.Version Methods (==) :: SemaphoreName -> SemaphoreName -> Bool # (/=) :: SemaphoreName -> SemaphoreName -> Bool # | |
type SemaphoreIdentifier = String Source #
The identifier string of a semaphore: a serialised SemaphoreName used
for inter-process communication (e.g. as a command line argument).
The specific format of this name string depends on the protocol version:
- For version 1, this is the unadorned semaphore name.
- For version
N >= 2, the semaphore name is prefixed withv<N>-.
newtype SemaphoreProtocolVersion Source #
The semaphore protocol version currently being used.
The version tracks the IPC mechanism, not the library version:
- POSIX: 2 (domain sockets, replacing v1 system semaphores).
- Windows: 1 (Win32 named semaphores, unchanged from v1).
- Unsupported platforms: 0 (no compatible IPC backend).
Constructors
| SemaphoreProtocolVersion | |
Fields | |
Instances
data SemaphoreError Source #
Errors that can occur when creating or opening a semaphore.
Constructors
| SemaphoreAlreadyExists | Can't create a semaphore: a semaphore with this name already exists. |
Fields | |
| SemaphoreDoesNotExist | Can't open a semaphore: no semaphore with this name exists. |
Fields | |
| SemaphoreIncompatibleVersion | Protocol version incompatibility: the semaphore identifier uses a different protocol version than the library is currently using. |
| SemaphoreOtherError | An |
Fields | |
Instances
| Exception SemaphoreError Source # | |
Defined in System.Semaphore.Internal.Version Methods toException :: SemaphoreError -> SomeException # | |
| Show SemaphoreError Source # | |
Defined in System.Semaphore.Internal.Version Methods showsPrec :: Int -> SemaphoreError -> ShowS # show :: SemaphoreError -> String # showList :: [SemaphoreError] -> ShowS # | |
| Eq SemaphoreError Source # | |
Defined in System.Semaphore.Internal.Version Methods (==) :: SemaphoreError -> SemaphoreError -> Bool # (/=) :: SemaphoreError -> SemaphoreError -> Bool # | |
semaphoreVersion :: SemaphoreProtocolVersion Source #
The protocol version used on this host platform with this version of
semaphore-compat.
semaphoreIdentifier :: SemaphoreName -> SemaphoreIdentifier Source #
The serialised identifier of a SemaphoreName for inter-process
communication.
See SemaphoreIdentifier for more information.
parseSemaphoreIdentifier :: SemaphoreIdentifier -> Maybe SemaphoreName Source #
Parse a SemaphoreIdentifier into a SemaphoreName.
Returns Nothing for unversioned strings (which should be treated as
v1 by the caller's compatibility logic).
getSemaphoreSocketPath :: SemaphoreName -> IO FilePath Source #
The socket file path for a semaphore.