Skip to content

Instantly share code, notes, and snippets.

Rowell Belen bytekast

Block or report user

Report or block bytekast

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
serverless create \
--template-url \
--path my-springboot-service
cd my-springboot-service
./gradlew clean build # build
./gradlew bootRun # run locally
curl http://localhost:8080/greeting # test locally
serverless deploy # deploy
View task.gradle
task(buildJson) {
doLast {
new File("$buildDir/build.json").newWriter().withWriter { w ->
w << JsonOutput.toJson([distribution: relativePath(jar.archivePath), version: jar.version])
jar.finalizedBy buildJson
bytekast /
Last active Feb 26, 2018
create microservice template
serverless create \
--template-url \
--path myservice
bytekast / AbstractEventHandler.groovy
Created Dec 7, 2017
Common Base Handler for Lambda Functions
View AbstractEventHandler.groovy
package com.stedi.platform.lambda
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.codehaus.groovy.runtime.StackTraceUtils
abstract class AbstractEventHandler implements CommonTrait, AmazonSNSTrait, DataDogTrait, SentryTrait {
bytekast / promiseChaining.groovy
Last active Aug 29, 2017
Chaining Promises in Groovy GPars
View promiseChaining.groovy
final successHandler = { controller.successEvent(context, transmissionUuid, parcel) }
final errorHandler = { Exception e -> controller.errorEvent(context, transmissionUuid, parcel, e) }
task {, parcel) }
.then { download ->, transmissionUuid, parcel) }
.then { download -> controller.forward(download, transmissionUuid, parcel) }
.then { controller.delete(sessionId, }
.then(successHandler, errorHandler)
View build.gradle
apply plugin: 'groovy'
repositories {
dependencies {
View serverless.yml
service: user-service
name: aws
runtime: java8
memorySize: 1536
timeout: 60
artifact: build/distributions/
View VertxHandler.groovy
package com.serverless
import io.vertx.core.AbstractVerticle
import io.vertx.core.Vertx
import java.util.concurrent.CompletableFuture
import java.util.concurrent.TimeUnit
View VertxLambdaHandler.groovy
class VertxLambdaHandler implements RequestHandler<Map, Response> {
static void main(String[] args) throws Exception {
View loadTest.groovy
@Grab(group='org.codehaus.gpars', module='gpars', version='1.2.1')
import static groovyx.gpars.GParsPool.withPool
withPool(100) {
(1..2000).eachParallel { i ->
def beginTime = System.currentTimeMillis()
def result = ''.toURL().text
println "${i}: ${System.currentTimeMillis() - beginTime}"
You can’t perform that action at this time.