Skip to content

Latest commit

 

History

History
executable file
·
15 lines (11 loc) · 595 Bytes

README.md

File metadata and controls

executable file
·
15 lines (11 loc) · 595 Bytes

User event

This example is a small program that shows how use user defined events and metrics.

First, we define our own UserRules, a custom event MakePizza. Then we create a server and fire two MakePizza events.
Before exiting, the program prints to the terminal the json serialized content of the battle history.

Run the example with:

cargo run --example user-event --all-features

The program is implemented in two source code files:

  • rules.rs: rules definition (user rules, in particular).
  • main.rs: manages the battle and creates a few events.