ot-0.2.0.0: Real-time collaborative editing with Operational Transformation

Safe HaskellSafe-Inferred
LanguageHaskell98

Control.OperationalTransformation.Server

Synopsis

Documentation

data ServerState doc op Source

The server keeps the current revision number and a list of previous operations to transform incoming operations against.

Constructors

ServerState Revision doc [op] 

applyOperation Source

Arguments

:: (OTSystem doc op, OTCursor cursor op) 
=> ServerState doc op 
-> Revision

The latest operation that the client has received from the server when it sent the operation.

-> op

The operation received from the client.

-> cursor

The clients cursor position after the operation. (Use () if not needed.)

-> Either String (op, cursor, ServerState doc op)

The operation and the cursor to broadcast to all connected clients (except the client which has created the operation; that client must be sent an acknowledgement) and the new state (or an error).

Handles incoming operations.