TerminalWitchcraft / actix-ratelimit

Rate limiter framework for Actix web
MIT License
126 stars 25 forks source link

Upgrade the project to Actix 4.0.0 #13

Open stevefan1999-personal opened 3 years ago

stevefan1999-personal commented 3 years ago

This is not yet finalized, as there is some substantial change in the source code.

More specifically, there happen to have Request type param removed in several traits, and that MailboxError does not implement ResponseError anymore. I substituted ServiceRequest into the type param and it should work as intended.

I workaround the latter by adding an extra function call ErrorInternalServerError using map_err to wrap the error up. It's a convenient workaround but it's not very effective. I checked the diff from 3.x to 4.x and see that from MailboxError to ResponseError is transformed to an ISE, this is how I come up with this idea.

Yet, copy pasting map_err(ErrorInternalServerError) isn't very fun and tedious, but since this is an upstream Actix problem, why don't we just go blind first for a few moments.

Until the review passed on the ISE part and all the crate has graduated from beta then, let's keep it a draft.

vicky5124 commented 3 years ago

Is this going forward? Actix 4 is long out of beta (only actix-rt, upz)

Kavan72 commented 3 years ago

any update of this one ?

Tristaan commented 3 years ago

The user making this has dissapeared from the face of the world. So now somebody else has to do it. I'll check it out.

poisson-fish commented 2 years ago

The user making this has dissapeared from the face of the world. So now somebody else has to do it. I'll check it out.

See my pull request here for working actix4 code