Motoko jazz
Jazz rhythms can range from simple to extremely complex. However, underlying even the most complex rhythms performed by each individual musician in a jazz group is an underlying pulse (the beat)
-(Warning! Not production ready. Also currently it's very expensive)
Add this in your actor
// JAZZ BEING ---
let jazz = Jazz.Jazz();
system func heartbeat() : async () { ignore jazz.heartbeat() };
// JAZZ END -----
Execute a function after 5 seconds
jazz.delay(5, func() : () {
//...
});
Execute a function up to 3 times with 5 seconds interval (retrying gets cancelled if the function returns true)
ignore jazz.retry(3, 5, func() : async Bool {
//....
false;
});
License MIT