tree: d5cea13cdf8e42bdd61537f9a7456012ed3c929f [path history] [tgz]
  1. BUILD.gn
  2. README.md
  3. generator.cc
  4. generator.h
  5. meta/
  6. todo.cc
  7. todo.h
peridot/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