Skip to content
This repository
Newer
Older
100644 59 lines (45 sloc) 1.879 kb
fccc6851 » MLstate
2011-06-21 Initial open-source release
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (*
19 @author Louis Gesbert
20 **)
21
22 (*
23 Note: use OO to do this directly with inheritance ??
24 could give some interesting properties...
25 *)
26
27 open Cps.Ops
28
29 module F (Bk: Badop.S) = struct
30 type database = Bk.database
31 type transaction = Bk.transaction
32 type revision = Bk.revision
33
34 let open_database options k = Bk.open_database options @> k
35 let close_database db k = Bk.close_database db @> k
36 let status db k = Bk.status db @> fun st -> Badop.Layer("Wrapper_template", st) |> k
37
38
39 module Tr = struct
3321f323 » Louis Gesbert
2011-06-29 [enhance] database: fatal database errors now trigger the fail-transa…
40 let start db errk k = Bk.Tr.start db errk @> k
41 let start_at_revision db rev errk k = Bk.Tr.start_at_revision db rev errk @> k
fccc6851 » MLstate
2011-06-21 Initial open-source release
42 let prepare tr k = Bk.Tr.prepare tr @> k
43 let commit tr k = Bk.Tr.commit tr @> k
44 let abort tr k = Bk.Tr.abort tr @> k
45 end
46
47 type 'which read_op = 'which Bk.read_op
48 type 'which write_op = 'which Bk.write_op
49
50 let read tr path read_op k = Bk.read tr path read_op @> k
51 let write tr path write_op k = Bk.write tr path write_op @> k
52 let write_list tr l_path_write_op k = Bk.write_list tr l_path_write_op @> k
53
54 let node_properties db config k = Bk.node_properties db config @> k
55
56 module Debug = struct
57 let revision_to_string = Bk.Debug.revision_to_string
58 end
59 end
Something went wrong with that request. Please try again.