/
disk-io.js
30 lines (24 loc) · 867 Bytes
/
disk-io.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2010 Barricane Technology Ltd., All Rights Reserved.
/// Released under the MIT open source licence.
// This module contains the DiskIO code.
// The DiskIO constructor creates an object which can be used by DB to interact
// with the outside world. Other IOs will be possible in future, including
// ReplicationIO.
function DiskIO(options) {
if (!options) {
options = {};
}
this.path = options.path || '/tmp/barricane.db';
// Writes must be counted, so we only close the file whwn all has been
// written.
this.outstandingWrites = 0;
}
// This writes the serialise object to disk.
DiskIO.prototype.write = function(serialisedObject) {
}
// Read serialises objects back from disk, and
// <code>callback(err, result)</code> for each one.
DiskIO.prototype.read = function(callback) {
}
// Export the symbols.
exports.DiskIO = DiskIO;