| 1 | package DBM::Deep::Storage; | ||
| 2 | |||
| 3 | 47 | ▶ | use 5.006_000; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 47 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 47 | ▶ | use warnings FATAL => 'all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | =head2 flush() | ||
| 9 | |||
| 10 | This flushes the filehandle. This takes no parameters and returns nothing. | ||
| 11 | |||
| 12 | =cut | ||
| 13 | |||
| 14 | 0 | ▶ | sub flush { die "flush must be implemented in a child class" } |
|
Subroutine
flush: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 15 | |||
| 16 | =head2 is_writable() | ||
| 17 | |||
| 18 | This takes no parameters. It returns a boolean saying if this filehandle is | ||
| 19 | writable. | ||
| 20 | |||
| 21 | Taken from L<http://www.perlmonks.org/?node_id=691054/>. | ||
| 22 | |||
| 23 | =cut | ||
| 24 | |||
| 25 | 0 | ▶ | sub is_writable { die "is_writable must be implemented in a child class" } |
|
Subroutine
is_writable: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 26 | |||
| 27 | =head1 LOCKING | ||
| 28 | |||
| 29 | This is where the actual locking of the storage medium is performed. | ||
| 30 | Nested locking is supported. | ||
| 31 | |||
| 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. | ||
| 34 | |||
| 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. | ||
| 38 | |||
| 39 | The following methods manage the locking status. In all cases, they take | ||
| 40 | a L<DBM::Deep> object and returns nothing. | ||
| 41 | |||
| 42 | =over 4 | ||
| 43 | |||
| 44 | =item * lock_exclusive( $obj ) | ||
| 45 | |||
| 46 | Take a lock usable for writing. | ||
| 47 | |||
| 48 | =item * lock_shared( $obj ) | ||
| 49 | |||
| 50 | Take a lock usable for reading. | ||
| 51 | |||
| 52 | =item * unlock( $obj ) | ||
| 53 | |||
| 54 | Releases the last lock taken. If this is the outermost lock, then the | ||
| 55 | object is actually unlocked. | ||
| 56 | |||
| 57 | =back | ||
| 58 | |||
| 59 | =cut | ||
| 60 | |||
| 61 | 0 | ▶ | sub lock_exclusive { die "lock_exclusive must be implemented in a child class" } |
|
Subroutine
lock_exclusive: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 62 | 0 | ▶ | sub lock_shared { die "lock_shared must be implemented in a child class" } |
|
Subroutine
lock_shared: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 63 | 0 | ▶ | sub unlock { die "unlock must be implemented in a child class" } |
|
Subroutine
unlock: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 64 | |||
| 65 | 47 | 1; | |
| 66 | __END__ | ||