(inner: Arc<RateLimiterGroupInner>)
| 56 | |
| 57 | impl RateLimiterGroupHandle { |
| 58 | fn new(inner: Arc<RateLimiterGroupInner>) -> result::Result<Self, Error> { |
| 59 | let eventfd = Arc::new(EventFd::new(0).map_err(Error::EventFd)?); |
| 60 | inner.handles.lock().unwrap().push(eventfd.clone()); |
| 61 | Ok(Self { eventfd, inner }) |
| 62 | } |
| 63 | |
| 64 | /// Attempts to consume tokens and returns whether that is possible. |
| 65 | /// |