어플리케이션 요소들을 Java, JavaScript, CoffeeScript, Ruby, Python 또는 Groovy등으로 작성해 보세요.
혹은 한 어플리케이션에서 여러 언어들을 같이 사용할 수도 있습니다.
지나치게 단순하지는 않습니다.
간단하고 강력한 API를 사용하려 non-blocking 네트워크가 가능한 어플리케이션을 쉽게 작성해 보세요. 복잡한 설정이나 표준 따위는 필요없습니다.
메세지 전달 인터페이스로 확장하여 서버의 코어들을 효율적으로 활용합니다.
Non blocking I/O 로 여러 연결을 최소한의 스레드로 처리합니다.
간단한 Actor 모델같은 동시성 모델로 기존의 멀티스레드 프로그래밍의 번거로움으로부터 벗어날 수 있습니다.
분산 이벤트 버스가 Vert.x 전반에 걸쳐 서버측 구성요소들을 연결해 줍니다.
원하는 어떤 언어로든지 구성요소들을 작성하고 네트워크의 원하는 곳에 올려보세요. 심지어 브라우저에서 실행되는 Javascript 내부에도 들어갈 수 있습니다!
모든 플랫폼에서 Vert.x가 작동하는 것을 원하지 않으면 라이브러리 형식으로 기존 Java 어플리케이션에 임베디드할 수 있습니다.
Vert.x 에게는 강력한 모듈 시스템이 있습니다. Vert.x 구성요소들을 캡슐화 하고 재사용하기 위해 패키징해보세요.
Maven Central나 다른 Maven 저장소 혹은 Bintray에서 그런 모듈들을 공유해 보세요.
Advertise your module in the module registry.
Seamlessly code, run, debug and test your Vert.x applications in your favourite IDE.
Get started using Maven using the Maven archetype or using Gradle with the example Gradle template project.
Use auto-redeploy to see your changes instantly in a running module.
100% open source. Licensed under the Apache Software License 2.0
Save the following in server.js
var vertx = require('vertx');
vertx.createHttpServer().requestHandler(function(req) {
var file = req.path() === '/' ? 'index.html' : req.path();
req.response.sendFile('webroot/' + file);
}).listen(8080)
Run it:
vertx run server.js
Save the following in Server.java
import org.vertx.java.core.Handler;
import org.vertx.java.core.http.HttpServerRequest;
import org.vertx.java.platform.Verticle;
public class Server extends Verticle {
public void start() {
vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
String file = req.path().equals("/") ? "index.html" : req.path();
req.response().sendFile("webroot/" + file);
}
}).listen(8080);
}
}
Run it: (note no compile is needed!)
vertx run Server.java
Save the following in server.rb
require "vertx"
Vertx::HttpServer.new.request_handler do |req|
file = req.uri == "/" ? "index.html" : req.uri
req.response.send_file "webroot/#{file}"
end.listen(8080)
Run it:
vertx run server.rb
Save the following in Server.groovy
vertx.createHttpServer().requestHandler { req ->
def file = req.uri == "/" ? "index.html" : req.uri
req.response.sendFile "webroot/$file"
}.listen(8080)
Run it:
vertx run Server.groovy
Save the following in server.py
import vertx
server = vertx.create_http_server()
@server.request_handler
def request_handler(req):
file = "index.html" if req.uri == "/" else req.uri
req.response.send_file("webroot/%s"%file)
server.listen(8080)
Run it:
vertx run server.py
Save the following in server.clj
(ns example.server
(:require [vertx.http :as http]))
(-> (http/server)
(http/on-request
(fn [req]
(let [uri (.uri req)]
(-> req
(http/server-response)
(http/send-file (str "webroot/" (if (= "/" uri) "index.html" uri)))))))
(http/listen 8080))
Run it:
vertx run server.clj
This website is licensed under the Creative
Commons Attribution-ShareAlike 3.0 Unported License.