tree: b90e5dd82c6c5701495e6a2d4d63a2f572772c28 [path history] [tgz]
  1. meta/
  2. BUILD.gn
  3. generator.cc
  4. generator.h
  5. README.md
  6. todo.cc
  7. todo.h
examples/todo_cpp/README.md

todo (headless)

Example module that uses Ledger to store internal data.

To run the module, run:

basemgr --base_shell=dev_base_shell --session_shell=dev_session_shell --session_shell_args=--root_module=example_todo_headless

This is a headless module, taking no input and writing the output to stdout.

The module keeps a list of todo items in a Ledger page, randomly adds and removes items, and prints the state after each modification. Items generated by each instance are tagged with a unique tag. To observe the application running on multiple devices and synchronizing the state using Ledger, set up Cloud Sync and run the module on each device.

Example output:

[00053.199] 02933.02949> --- To Do ---
[00053.199] 02933.02949> [ 18355 ] write a spec for the law of gravity
[00053.199] 02933.02949> [ 24673 ] celebrate hipster bars south of Pigalle
[00053.200] 02933.02949> [ 24673 ] solve the society
[00053.200] 02933.02949> [ 18355 ] draw the pyramids
[00053.200] 02933.02949> [ 24673 ] evaluate a better way forward