Removed extraneous slashes from POD
[dbsrgits/DBM-Deep.git] / lib / DBM / Deep / Storage.pm
CommitLineData
2c70efe1 1package DBM::Deep::Storage;
2
3use 5.006_000;
4
5use strict;
6use warnings FATAL => 'all';
7
8=head2 flush()
9
10This flushes the filehandle. This takes no parameters and returns nothing.
11
12=cut
13
14sub flush { die "flush must be implemented in a child class" }
15
16=head2 is_writable()
17
18This takes no parameters. It returns a boolean saying if this filehandle is
19writable.
20
21Taken from L<http://www.perlmonks.org/?node_id=691054/>.
22
23=cut
24
25sub is_writable { die "is_writable must be implemented in a child class" }
26
27=head1 LOCKING
28
29This is where the actual locking of the storage medium is performed.
30Nested locking is supported.
31
32B<NOTE>: It is unclear what will happen if a read lock is taken, then
33a write lock is taken as a nested lock, then the write lock is released.
34
35Currently, the only locking method supported is flock(1). This is a
36whole-file lock. In the future, more granular locking may be supported.
37The API for that is unclear right now.
38
39The following methods manage the locking status. In all cases, they take
1c62d370 40a L<DBM::Deep> object and returns nothing.
2c70efe1 41
42=over 4
43
44=item * lock_exclusive( $obj )
45
46Take a lock usable for writing.
47
48=item * lock_shared( $obj )
49
50Take a lock usable for reading.
51
52=item * unlock( $obj )
53
54Releases the last lock taken. If this is the outermost lock, then the
55object is actually unlocked.
56
57=back
58
59=cut
60
61sub lock_exclusive { die "lock_exclusive must be implemented in a child class" }
62sub lock_shared { die "lock_shared must be implemented in a child class" }
63sub unlock { die "unlock must be implemented in a child class" }
64
651;
66__END__