This reducer is run at module initialization.
(ReducerContext ctx)
| 236 | |
| 237 | // This reducer is run at module initialization. |
| 238 | [Reducer(ReducerKind.Init)] |
| 239 | public static void init(ReducerContext ctx) |
| 240 | { |
| 241 | ctx.Db.repeating_test_arg.Insert(new RepeatingTestArg |
| 242 | { |
| 243 | prev_time = ctx.Timestamp, |
| 244 | scheduled_id = 0, |
| 245 | scheduled_at = new TimeDuration(1000000) |
| 246 | }); |
| 247 | |
| 248 | var currentTime = ctx.Timestamp; |
| 249 | var oneSeconds = new TimeDuration { Microseconds = 1_000_000 }; |
| 250 | var futureTimestamp = currentTime + oneSeconds; |
| 251 | |
| 252 | ctx.Db.nonrepeating_test_arg.Insert(new NonrepeatingTestArg |
| 253 | { |
| 254 | prev_time = ctx.Timestamp, |
| 255 | scheduled_id = 0, |
| 256 | scheduled_at = new ScheduleAt.Time(futureTimestamp) |
| 257 | }); |
| 258 | } |
| 259 | |
| 260 | [Reducer] |
| 261 | public static void repeating_test(ReducerContext ctx, RepeatingTestArg arg) |