You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CaptureFile.CaptureFile.md
+19-13Lines changed: 19 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,11 @@ If the capture file does not already exist and it is opened for write, or if `fo
9
9
10
10
The `encoding` argument is used to decode records that are returned. The default is `utf8`, which means the binary records stored in the capture file will be decoded into strings using the utf8 encoding before being returned. If `encoding=None` is set, then the raw bytes will be returned. All of the encodings available at https://docs.python.org/3/library/codecs.html#standard-encodings are valid.
11
11
12
-
Only one process can open a capture file for writing at a time. Multiple processes can open the same capture file for read simultaneously with each other and with one process that opens it for write.
12
+
To ensure only one process can open a capture file for writing at a time set `use_os_file_locking` to True. Multiple processes can always open the same capture file for read simultaneously with each other and with one process that opens it for write.
13
+
14
+
Single process but multi-threaded applications do not need `use_os_file_locking` to be True because the CaptureFile module will manage contention using in-memory locks. File locking in some Linux operating/file systems does not work well across servers and even sometimes on a single server so be sure to verify any specific scenario that depends on file locking.
15
+
16
+
By default the CaptureFile is tuned for a commit size of approximately 32KB by having the default value of `compression_block_size` set to 32768. Any amount less than this is re-written every commit until the amount of data equals or exceeds this number at which point the data is compressed, written out and (mostly) never re-written again. If commits will typically contain substantially more than 32KB of data, setting `compression_block_size` to a larger number can improve the amount of compression obtained, resulting in a smaller CaptureFile.
13
17
14
18
An `InvalidCaptureFile` exception is raised if this constructor is used to open a file that is not a valid capture file, is in an unsupported version of the capture file format, or is a corruptted.
15
19
@@ -20,10 +24,12 @@ An `InvalidCaptureFile` exception is raised if this constructor is used to open
0 commit comments