File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,11 @@ async fn main() {
1212
1313 let remote_url = "http://localhost:4007" ;
1414 let server_sdk_key = "server-8ed48815ef044428826787e9a238b9c6a479f98c" ;
15+ let interval = Duration :: from_millis ( 100 ) ;
1516 let config = FPConfig {
1617 remote_url : remote_url. to_owned ( ) ,
1718 server_sdk_key : server_sdk_key. to_owned ( ) ,
18- refresh_interval : Duration :: from_secs ( 5 ) ,
19+ refresh_interval : interval ,
1920 #[ cfg( feature = "use_tokio" ) ]
2021 http_client : None ,
2122 wait_first_resp : true ,
@@ -36,12 +37,14 @@ async fn main() {
3637
3738 let detail = fp. number_detail ( "promotion_activity" , & user, 9.0 ) ;
3839 println ! ( " => reason : {:?}" , detail. reason) ;
39- println ! ( " => index : {:?}" , detail. rule_index) ;
40+ println ! ( " => rule index : {:?}" , detail. rule_index) ;
4041
4142 let user2 = FPUser :: new ( "user_id" ) . with ( "city" , "New York" ) ;
4243 let discount2 = fp. number_value ( "promotion_activity" , & user2, 9.0 ) ;
4344 println ! (
4445 "Result => discount for user in New York is : {:?}" ,
4546 discount2
4647 ) ;
48+
49+ tokio:: time:: sleep ( interval) . await ;
4750}
You can’t perform that action at this time.
0 commit comments