1 package DBM::Deep::Storage;
6 use warnings FATAL => 'all';
10 This flushes the filehandle. This takes no parameters and returns nothing.
14 sub flush { die "flush must be implemented in a child class" }
18 This takes no parameters. It returns a boolean saying if this filehandle is
21 Taken from L<http://www.perlmonks.org/?node_id=691054/>.
25 sub is_writable { die "is_writable must be implemented in a child class" }
29 This is where the actual locking of the storage medium is performed.
30 Nested locking is supported.
32 B<NOTE>: It is unclear what will happen if a read lock is taken, then
33 a write lock is taken as a nested lock, then the write lock is released.
35 Currently, the only locking method supported is flock(1). This is a
36 whole-file lock. In the future, more granular locking may be supported.
37 The API for that is unclear right now.
39 The following methods manage the locking status. In all cases, they take
40 a L<DBM::Deep/> object and returns nothing.
44 =item * lock_exclusive( $obj )
46 Take a lock usable for writing.
48 =item * lock_shared( $obj )
50 Take a lock usable for reading.
52 =item * unlock( $obj )
54 Releases the last lock taken. If this is the outermost lock, then the
55 object is actually unlocked.
61 sub lock_exclusive { die "lock_exclusive must be implemented in a child class" }
62 sub lock_shared { die "lock_shared must be implemented in a child class" }
63 sub unlock { die "unlock must be implemented in a child class" }