Skip to content

Mappedbus v0.5.1

Latest
Compare
Choose a tag to compare
@caplogic caplogic released this 21 Mar 08:57
· 18 commits to master since this release

The format of the memory mapped file has changed so make sure to delete old files if you have previously used an earlier version.

Changes:

  • Removed the "append" parameter in the constructor of MappedBusWriter which indicated whether to append data to the file if it already exists. The default behavior is now always to append if the file exists.
  • The two separate commit and rollback fields have been merged into a single "status flag" field which can take three possible values: not set, committed, rolled back. The status flag is updated using compare-and-swap.
  • The write() method now returns a boolean to indicate if the write succeeded. The scenario for a write to fail is when a writer did not update the status flag to commit in time, and a reader which has timed out already set it to indicate a rollback. A simple way to handle a failed write is to simply try write again. The next attempt will be done in a new record.