VirusTotalNet icon indicating copy to clipboard operation
VirusTotalNet copied to clipboard

Upgrade versions and used Handler interface

Open pmlopes opened this issue 4 years ago • 3 comments

Signed-off-by: Paulo Lopes [email protected]

The template was using an old version of vert.x and the handler should not implement the BodyHandler interface as it does not mean that you will get the HTTP body parsed. This needs to be passed on the bootstrap project and implement the vert.x Handler functional interface.

As a benefit this makes the function code smaller.

Still the original template or this PR do not expose the router to the function as a setup step. This would be interesting to chain middleware. As an example we could process CORS, or security before the function is executed.

Also post processing is not possible, for example a catch all error handler.

pmlopes avatar Jan 29 '20 20:01 pmlopes

Hi @pmlopes thank you for this PR, please could you rebase?

alexellis avatar Feb 05 '20 10:02 alexellis

@pmlopes Like the idea of exposing the router. But Vert.x is now at 4.0.0. Are there reasons we dont want to use the latest 4.0.0?

jconlon avatar Jan 27 '21 23:01 jconlon

@alexellis @jconlon This pr got lost on my side. Yes, we should upgrade it to 4.0.0. One of the improvements, application wize there should be almost to none code changes for the end user.

We could change the style from callback to future/promise style which improves readability and internally guarantees that the thread affinity is always correct as the future object will enforce it.

pmlopes avatar Jan 28 '21 07:01 pmlopes