Commit 2df82656 authored by Matt Traudt's avatar Matt Traudt
Browse files

Document the state.dat file a little bit

parent 38799a01
...@@ -136,6 +136,8 @@ In this directory you will find ...@@ -136,6 +136,8 @@ In this directory you will find
- `datadir` Once your sbws scanner has started gathering results, it will dump - `datadir` Once your sbws scanner has started gathering results, it will dump
them into this directory. Other sbws commands (such as generate and stats) them into this directory. Other sbws commands (such as generate and stats)
read results from the files in this directory. read results from the files in this directory.
- `state.dat` A file for storing state needed between sbws commands. See its
documentation for more information.
## Running tests ## Running tests
......
...@@ -25,6 +25,7 @@ Contents ...@@ -25,6 +25,7 @@ Contents
faq faq
glossary glossary
diagrams diagrams
state
sbws sbws
Proposals Proposals
......
...@@ -28,6 +28,14 @@ sbws.util.parser module ...@@ -28,6 +28,14 @@ sbws.util.parser module
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
sbws.util.state module
~~~~~~~~~~~~~~~~~~~~~
.. automodule:: sbws.util.state
:members:
:undoc-members:
:show-inheritance:
sbws.util.stem module sbws.util.stem module
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
......
The ``state.dat`` file
======================
This file contains state that multiple sbws commands may want access to and
that needs to persist across processes. Both read and write access to this file
is wrapped in the ``State`` class, allowing for safe concurrent access: the
file is locked before reading or writing, and (for now) only simple data types
are allowed so we can be sure to update the state file on disk every time the
state is modified in memory.
At the time of writing, the following fields can exist in the state file.
``scanner_started``
-------------------
The last time ``sbws scanner`` was started.
- **Producer**: ``sbws scanner``, once at startup.
- **Consumer**: ``sbws generate``, once each time it is ran.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment