Skip to content

Commit e4e8c82

Browse files
realaravinthgavrie
authored andcommitted
timer callback data is static
1 parent c673c14 commit e4e8c82

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/context/timer.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ impl Context {
2020
/// This function takes ownership of the provided data, and transfers it to Redis.
2121
/// The callback will get the original data back in a type safe manner.
2222
/// When the callback is done, the data will be dropped.
23-
pub fn create_timer<F, T>(&self, period: Duration, callback: F, data: T) -> RedisModuleTimerID
23+
pub fn create_timer<F, T: 'static>(
24+
&self,
25+
period: Duration,
26+
callback: F,
27+
data: T,
28+
) -> RedisModuleTimerID
2429
where
2530
F: FnOnce(&Context, T),
2631
{

0 commit comments

Comments
 (0)