@@ -171,18 +171,17 @@ where
171171 }
172172}
173173
174- pub struct HandlerLoop < R , K , H > {
175- pub req_queue : Arc < RwLock < DedupDeque < K , R > > > ,
174+ pub struct HandlerLoop < R : Request , H : Handler > {
175+ pub req_queue : Arc < RwLock < DedupDeque < R :: Key , R > > > ,
176176 pub cancel_token : CancellationToken ,
177177 pub task_notifier : Arc < Notify > ,
178178 pub request_handler : H ,
179179 pub limiter : Arc < CascadeRateLimiter < R > > ,
180180}
181181
182- impl < R , K , H > HandlerLoop < R , K , H >
182+ impl < R , H > HandlerLoop < R , H >
183183where
184- R : Request < Key = K > ,
185- K : Debug + Clone + Eq + Hash + Send + ' static ,
184+ R : Request ,
186185 H : Handler < Request = R > ,
187186{
188187 /// Runs scheduled requests dispatch loop.
@@ -220,14 +219,14 @@ where
220219 }
221220
222221 #[ inline]
223- async fn poll_task ( & self ) -> Option < ( K , R ) > {
222+ async fn poll_task ( & self ) -> Option < ( R :: Key , R ) > {
224223 let mut queue = self . req_queue . write ( ) . unwrap ( ) ;
225224 queue. pop_front ( )
226225 }
227226
228227 /// Puts request back to the front of request queue.
229228 #[ inline]
230- async fn put_back_req ( & self , key : K , req : R ) {
229+ async fn put_back_req ( & self , key : R :: Key , req : R ) {
231230 let mut queue = self . req_queue . write ( ) . unwrap ( ) ;
232231 queue. push_front ( key, req) ;
233232 }
0 commit comments