-
Notifications
You must be signed in to change notification settings - Fork 89
Added Scala template for Verticles #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
e9d2b42
ea046a4
5e221ce
4de1afc
53626a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,3 +20,4 @@ test-results | |
| test-tmp | ||
| *.class | ||
| mods | ||
| vertx_classpath.txt | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import org.vertx.scala.core.eventbus.Message | ||
|
|
||
| val log = container.logger | ||
| vertx.eventBus.registerHandler("ping-address", {message:Message[String] => | ||
| message.reply("pong!") | ||
| log info "Sent back pong scala!" | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,9 +12,15 @@ | |
| // Compiled Groovy verticle - note that they must be prefixed with 'groovy:' to distinguish them from compiled Java verticles | ||
| //"main":"groovy:com.mycompany.myproject.GroovyPingVerticle", | ||
|
|
||
| // Compiled Scala verticle - note that they must be prefixed with 'scala:' to distinguish them from compiled Java verticles | ||
| //"main":"scala:com.mycompany.myproject.ScalaPingVerticle", | ||
|
|
||
| // Groovy *script* verticle | ||
| //"main": "GroovyVerticle.groovy", | ||
|
|
||
| // Scala *script* verticle (No sirve todavia con las nuevas versiones del lang-scala) | ||
| //"main": "ScalaVerticle.scala", | ||
|
|
||
| // Ruby verticle | ||
| //"main":"ping_verticle.rb", | ||
|
|
||
|
|
@@ -25,6 +31,15 @@ | |
| //"main": "ping_verticle.py", | ||
|
|
||
|
|
||
| //If youre using the new version of scala with scala 2.11 | ||
| //""lang-impl":"io.vertx~lang-scala_2.10~1.0.1-RC3:org.vertx.scala.platform.impl.ScalaVerticleFactory", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be a single |
||
| //"lang-impl":"io.vertx~lang-scala_2.11~1.0.1-RC3:org.vertx.scala.platform.impl.ScalaVerticleFactory", | ||
|
|
||
| //Remember for FAT Jars to add thedependencies so the engine doesn't have to re-download them everytime | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| //"deploys": "io.vertx~lang-scala_2.11~1.0.1-RC3", | ||
| //"deploys": "io.vertx~lang-groovy~2.0.0-final", | ||
|
|
||
|
|
||
| // If your module is going to be registered in the Vert.x module registry you will also need the following | ||
| // mandatory fields | ||
| "description":"Put description of your module here", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.mycompany.myproject | ||
|
|
||
| import org.vertx.scala.platform.Verticle | ||
| import org.vertx.scala.core.eventbus.Message | ||
|
|
||
| /** | ||
| * ScalaPing Verticle | ||
| * Octavio Luna | ||
| * | ||
| */ | ||
|
|
||
| class ScalaPingVerticle extends Verticle{ | ||
| override def start(){ | ||
| val log = container.logger | ||
| vertx.eventBus.registerHandler("ping-address", {message:Message[String] => | ||
| message.reply("pong!") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the intendation is wrong somehow. Usually, Vert.x uses 2 spaces everywhere. |
||
| log info "Sent back pong scala!" | ||
| }) | ||
|
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm... sorry, what does that mean? :)