minghuaw / fe2o3-amqp

A rust implementation of the AMQP1.0 protocol based on serde and tokio.
MIT License
58 stars 7 forks source link

Allow customizing when to automatically re-fill the credit #199

Open minghuaw opened 1 year ago

minghuaw commented 1 year ago

Add a functionality that allow user to define a custom function in the form of FnOnce(u32) -> bool to determine when the credits will be re-filled automatically. The function will have no effect if the credit mode is not Auto. A default function that re-fills the credit at half of the total credit will be provided.