blob: 5eecf72966e8a734b298c80ee84e7d38915c3eb1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
type state = {snapshot: Concepts.Hash.hash}
class type implementation = object
method state : state
method pin : state -> unit
end
type Handle.protocol += Session of implementation
type t = implementation
let make impl = Session (impl :> implementation)
let from handle = Handle.into handle (function Session impl -> Some impl | _ -> None)
let state i = Handle.invoke i (fun o -> o#state)
let pin i state = Handle.invoke i (fun o -> o#pin state)
|