• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
My name is Trinidad
 

My name is Trinidad

on

  • 1,998 views

 

Statistics

Views

Total Views
1,998
Views on SlideShare
1,663
Embed Views
335

Actions

Likes
0
Downloads
16
Comments
0

5 Embeds 335

http://francescoagati.wordpress.com 328
http://paper.li 3
http://twitter.com 2
http://webcache.googleusercontent.com 1
http://a0.twimg.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    My name is Trinidad My name is Trinidad Presentation Transcript

    • My name is TrinidadDavid Calavera@calavera
    • Farmhouse conf!
    • Rubinius!
    • Why?
    • JSP Struts SpringHibernate
    • Rails
    • Rails SpringHibernate
    • maven<plugin> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <id>create-mock-web-descriptor</id>… <phase>compile</phase>
    • springclass UsersController < ApplicationController include_spring_bean :users_service def authorized?(user, action) @users_service.authorized?(user, action) endend
    • hibernateclass User < HibernateModel def self.find(id) hibernate.find_by_id(HUser.class, id) endend
    • development staging / production Mongrel Tomcat
    • development staging / production GF Gem Tomcat
    • development staging / production Jetty-Rails Tomcat
    • what about tomcat?
    • development staging / production Tomcat- Tomcat Rails
    • gem installtrinidadcd my_rails_applicationjruby -S trinidad
    • cd my_threadsafe_rails_applicationjruby -S trinidad -t
    • cd my_rack_applicationjruby -S trinidad -r
    • 1.2cd my_applicationjruby -S trinidad
    • conventionslib/ spring.jar hibernate.jar junit.jar
    • conventionsclasses/ Context.class FooBar.class BarBaz.class
    • conventionsconfig/ web.xml trinidad.yml
    • secure layer--- ssl: port: 3443 keystore: keystore.p12 ...
    • multiple apps--- web_apps: app1: context_path: /foo app2: rackup: config.ru
    • multiple apps$ jruby -S trinidad --apps webapps--- apps_base: webapps
    • extensible
    • gem installtrinidad_FOO_extension---extensions: FOO:
    • gem installtrinidad_FOO_extensiontrinidad --load FOO
    • server extensionmodule Trinidad::Extensions class FOOServerExtension < ServerExtension def configure(tomcat) ... end endend
    • app extensionmodule Trinidad::Extensions class FOOWebAppExtension < WebAppExtension def configure(tomcat, app_context) ... end endend
    • options extensionmodule Trinidad::Extensions class FOOOptionsExtension < OptionsExtension def configure(parser, default_options) ... end endend
    • daemon DAEMON
    • daemon--- extensions: daemon: pid_file: tmp/trinidad.pid jvm_args: -Xmx20Gb
    • ox db ans
    • ox db ans
    • sandbox$ curl http://example.com/sandbox/apps.xml<applications> <application> <name>default</name> <link href=".../default/start.xml" rel="start" /> <link href=".../default/stop.xml" rel="stop" /> <link href=".../default/restart.xml" rel="restart" />
    • sandbox howtoopts = { :context_path => /sandbox, :web_app_dir => sandbox, :public => app/public, :rackup => config.ru}
    • sandbox howtoweb_app = Trinidad::RackupWebApp.new({}, opts)app_ctx = tomcat.add_webapp( opts[:context_path], [:web_app_dir])app_ctx.add_lifecycle_listener( Trinidad::Lifecycle::Default.new(web_app))
    • hot deploy
    • hot deploy--- monitor: tmp/restart.txt
    • “ hi David,quick questionabouthot deploy... “
    • “ ... it would begreat if we couldhave real zerodown time “
    • 1.2Trinidad Zero
    • scheduler
    • schedulerclass ScheduledJob < TrinidadScheduler.Cron"0/5 * * * * ?" def run _logger.info "I’m printed every 5 seconds" endend
    • schedulerclass ScheduledJob < TrinidadScheduler.Simple:start => Time.now, :end => Time.now + 240 def run _logger.info "I’m printed every 5 seconds" endend
    • schedulerTrinidadScheduler.run_later do # 3 seconds _logger.info "I’m inside this block"endTrinidadScheduler.run_later(:delay => 20) do _logger.info "I’m inside this block"end
    • lifecycle
    • lifecyclemodule Trinidad::Lifecycle::WebApp class MyListener ... def lifecycle_event(event) if BEFORE_START_EVENT == event.type # do something before the app starts
    • lifecyclewhen Lifecycle::START_EVENTwhen Lifecycle::BEFORE_START_EVENTwhen Lifecycle::AFTER_START_EVENTwhen Lifecycle::STOP_EVENTwhen Lifecycle::BEFORE_STOP_EVENTwhen Lifecycle::AFTER_STOP_EVENTwhen Lifecycle::PERIODIC_EVENT
    • u e s qr e
    • resque--- extensions: resque: queues: critical,high,low redis_host: example.com:6379
    • what’s next?better rack integration?sandbox features?clustering?
    • github.com/trinidad
    • thank you!
    • creditshttp://www.flickr.com/photos/rooreynolds/243811287/http://www.sxc.hu/photo/1192923http://www.flickr.com/photos/streetfly_jz/2752896812http://www.flickr.com/photos/58376723@N07/5359060059/http://www.flickr.com/photos/cosacutro/4820222363/http://www.flickr.com/photos/darek-zon/2457168503/http://www.flickr.com/photos/veganstraightedge/5697792356http://www.flickr.com/photos/veganstraightedge/5696662117http://www.flickr.com/photos/drumminhands/4757641653/