Created
July 10, 2015 08:36
-
-
Save aesteve/c770005031d568d4e037 to your computer and use it in GitHub Desktop.
Some example on what we could benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an object | |
public class SomeObject { | |
public Date someDate; | |
public Integer someInt; | |
public String someString; | |
public Double someDouble; | |
} | |
// create vertx handler | |
router.put("/vertx", ctx -> { | |
JsonObject json = ctx.getBodyAsJson(); | |
json.put("someInt", json.getInteger("someInt") + ctx.request().param("someInt")); | |
// etc : do some stuff with all the attributes AND ALSO request parameters | |
ctx.response().end(json); | |
}); | |
// create the exact same (functionally speaking) handler with Nubes | |
@Controller("/nubes") | |
@ContentType("application/json") | |
public class BenchmarkController { | |
@PUT | |
public SomeObject changeTheObject(@RequestBody SomeObject original, @Param("someInt") Integer someInt, ...) { | |
original.someInt += someInt; | |
// etc. play with every attribute | |
return original; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment