Giter Club home page Giter Club logo

trinidad_scheduler_extension's Introduction

Trinidad

Trinidad allows you to run Rails and/or Rack applications within an embedded Tomcat container. Apache Tomcat (formerly also Jakarta Tomcat) is an open source web server and Servlet container with a long history that dates back to the previous millenia.

Trinidad's goals with bringing Tomcat into JRuby land are mostly the following :

  • flexibility especially in terms of configuration it allows you to tune (almost) everything from a simple trinidad.yml (or .rb) configuration file
  • portability there's no vendor lock-in as we use JRuby::Rack, thus even if you do some Java integration or use it's Rack Servlet extensions you're still able to migrate to a standalone Tomcat or any other Servlet container
  • easy Java integration (just in-case you need it, it's there)
  • extensions such as connection pooling (sharing pools between deployed Rails apps) and (threaded) worker adapters for Resque and Delayed::Job

Installation

gem version dependency status

$ jruby -S gem install trinidad

NOTE: please use 1.5.0.B2 gem install trinidad --pre, esp. on JRuby 9K, as Trinidad 1.4 will no longer receive Tomcat (7.0.x) security updates.

Trinidad 1.4 requires (and supports) JRuby 1.6.8 or later (latest 1.7.x recommended).

Quick Start

$ cd a-rails-app
$ jruby -S trinidad

Setup

If you use Bundler, you might want to add Trinidad to your Gemfile :

gem 'trinidad', :require => nil

However this is not absolutely necessary, you might simply gem install trinidad and than run trinidad - keep in mind a server is not an application dependency.

Rails

Trinidad supports the same Rails version as the JRuby-Rack it founds on (or is specified/locked in your Gemfile), which are 4.x, 3.x and even 2.3 for JRuby-Rack 1.1.x (and the up coming 1.2). Merb is not supported.

$ trinidad

or if you prefer to use the Rack handler (e.g. for development) use :

$ rails s trinidad

Please note all configuration options will work using the Rack handler mode, you should usually only use it for development/tests and run trinidad on production.

Sinatra

$ ruby app.rb -s Trinidad

or configure your application to always use Trinidad :

require 'sinatra'
require 'trinidad'

configure do
  set :server, :trinidad
end

Rack

Trinidad auto-detects a plain-old Rack application (if there's a config.ru) :

$ trinidad

You can as well pass the server name to rackup to start the Rack handler :

$ rackup -s trinidad

Or you can set Trinidad as the default server in your config.ru file :

#\ -s trinidad

Trinidad solves the Rack "chicken-egg" problem when booting from a rackup file the same way as JRuby-Rack (since it boots all applications), that is :

  • if a Bundler Gemfile is detected, it first does a bundle/setup to load rack
  • otherwise the rack (gem) version might be specified using a magic comment in config.ru as # rack.version: ~>1.4.0 (or the latest installed gem is used)

NOTE: We recommend to use the plain trinidad mode for running apps (in production), since it supports runtime pooling while the "rackup" mode does not, it also provides you with better Java integration possibilities.

Also note that Trinidad does not mimic JRuby-Rack's (1.1.x) backwards compatible behavior of starting a pool for Rails but booting a thread-safe runtime for plain Rack applications by default. Runtime pooling is the default with Trinidad 1.4 and stays the same no matter the type of the application. This has changed in Trinidad 1.5 and it assumes thread-safe applications by default.

All major rack versions (< 2.0) are expected to be working fine with Trinidad.

Configuration

Trinidad allows you to configure parameters from the command line, the following is a list of the currently supported options (try trinidad -h):

  * -d, --dir ROOT_DIR            =>  web application root directory
  * -e, --env ENVIRONMENT         =>  rack (rails) environment
  * --rackup [RACKUP_FILE]        =>  rackup configuration file
  * --public PUBLIC_DIR           =>  web application public root
  * -c, --context CONTEXT         =>  application context path
  * --monitor MONITOR_FILE        =>  monitor for application re-deploys
  * -t, --threadsafe              =>  force thread-safe mode (use single runtime)
  * --runtimes MIN:MAX            =>  use given number of min/max jruby runtimes
  * -f, --config [CONFIG_FILE]    =>  configuration file
  * --address ADDRESS             =>  host address
  * -p, --port PORT               =>  port to bind to
  * -s, --ssl [SSL_PORT]          =>  enable secure socket layout
  * -a, --ajp [AJP_PORT]          =>  enable the AJP web protocol
  * --java_lib LIB_DIR            =>  contains .jar files used by the app
  * --java_classes CLASSES_DIR    =>  contains java classes used by the app
  * -l, --load EXTENSION_NAMES    =>  load options for extensions
  * --apps_base APPS_BASE_DIR     =>  set applications base directory
  * -g, --log LEVEL               =>  set logging level

You can also specify a default web.xml to configure your web application. By default the server tries to load the file config/web.xml but you can change the path by adding the option default_web_xml within your configuration file.

YAML Configuration

The server can be configured from a .yml file. By default, if a file is not specified, the server tries to load config/trinidad.yml. Within this file you can specify options available on the command line and tune server settings or configure multiple applications to be hosted on the server.

Advanced configuration options are explained in the wiki: http://wiki.github.com/trinidad/trinidad/advanced-configuration

$ jruby -S trinidad --config my_trinidad.yml
---
  port: 4242
  address: 0.0.0.0

Ruby Configuration

As an alternative to the config/trinidad.yml file, a .rb configuration file might be used to setup Trinidad. It follows the same convention as the YAML configuration - the file config/trinidad.rb is loaded by default if exists.

Trinidad.configure do |config|
  config.port = 4242
  config.address = '0.0.0.0'
  #config[:custom] = 'custom'
end

Logging

As you might notice on your first trinidad the server uses standard output :

kares@theborg:~/workspace/trinidad/MegaUpload$ trinidad -p 8000 -e staging
Initializing ProtocolHandler ["http-bio-8000"]
Starting Servlet Engine: Apache Tomcat/7.0.28
Starting ProtocolHandler ["http-bio-8000"]
Context with name [/] has started rolling
Context with name [/] has completed rolling

It also prints warnings and error messages on error output, while application specific log messages (e.g. logs from Rails.logger) always go into the expected file location at log/{environment}.log.

Application logging performs daily file rolling out of the box and only prints messages to the console while it runs in development mode, that means you won't see any application specific output on the console say in production !

Please note that these logging details as well as the logging format will be configurable with trinidad.yml/.rb within the next 1.4.x release.

If you plan to use a slice of Java with your JRuby and require a logger, consider using ServletContext#log. By default it is setup in a way that logging with ServletContext ends up in the same location as the Rails log. If this is not enough you can still configure a Java logging library e.g. SLF4J, just make sure you tell Trinidad to use it as well, if needed, using the jruby.rack.logging context parameter in web.xml.

Context Configuration

For slightly advanced (and "dirty" XML :)) application configuration Trinidad also supports the exact same context.xml format as Tomcat. Each web app is represented as a context instance and might be configured as such. You do not need to repeat configuring the same parameters you have already setup with the Trinidad configuration. This is meant to be mostly for those familiar with Tomcat internals. Currently the application's context.xml is expected to be located on the class-path under your [classes]/META-INF directory.

Context Doc: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

Serving Assets

Trinidad uses Tomcat's built-in capabilities to server your public files. We do recommend compiling assets up front and disabling the asset server (in production) if you're using the asset pipeline in a Rails application. If you do not put a web-server such as Apache in front of Trinidad you might want to configure the resource caching (on by default for env != development) for maximum performance e.g. by default it's configured as follows :

---
  public:
    root: public # same as the above "public: public" setting
    cached: true # enable (in-memory) asset caching on for env != 'development'
    cache_ttl: 5000 # cache TTL in millis (might want to increase this)
    cache_max_size: 10240 # the maximum cache size in kB
    cache_object_max_size: 512 # max size for a cached object (asset) in kB
    #aliases: # allows to "link" other directories into the public root e.g. :
      #/home: /var/local/www

Note that this configuration applies to (server-side) resource caching on top of the "public" file-system. You do not need to worry about client side caching, it is handled out of the box with ETag and Last-Modified headers being set.

You might also "mount" file-system directories as aliases to your resources root to be served by your application (as if they were in the public folder).

NOTE: In development mode if you ever happen to rake assets:precompile make sure to remove your public/assets directory later, otherwise requests such as /assets/application.js?body=1.0 might not hit the Rails runtime.

Hot Deployment

Trinidad supports monitoring a file to reload applications, when the file tmp/restart.txt is updated (e.g. touch tmp/restart.txt on Unix or type nul >>tmp\restart.txt & copy /b tmp\restart.txt +,, on Windows), the server reloads the application the monitor file belongs to. This monitor file can be customized with the monitor configuration option.

Since version 1.4.0 Trinidad supports 2 reload strategies :

  • restart (default) synchronous reloading. This strategy pauses incoming requests while it reloads the application and then serves them once ready (or timeouts if it takes too long). It is the default strategy since 1.4.0 due it's more predictable memory requirements.

  • rolling a.k.a. "zero-downtime" (asynchronous) reloading strategy similar to Passenger's rolling reloads. This has been the default since 1.1.0 up till the 1.3.x line. If you use this you should account that your JVM memory requirements might increase quite a lot (esp. if you reload under heavy loads) since requests are being served while there's another version of the application being loaded.

NOTE: due the way class-loaders where setup internally, Trinidad might have failed releasing memory with reloads. This has been fixed in 1.5.0 please consider updating, it is meant to be backwards compatible.

If you're on Java 6 you will likely need to tune your JAVA_OPTS / JRUBY_OPTS for the JVM to do class unloading (consult the wiki for more information) :

JRUBY_OPTS="$JRUBY_OPTS -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled"

Configure the reload strategy per web application or globally e.g. :

---
  port: 8080
  environment: production
  reload_strategy: rolling

Virtual Hosts

It's possible to use Trinidad with multiple hosts and load the applications under them automatically. A (virtual) host represents an association of a network name (such as "www.example.com" with the particular server on which Tomcat is running. Please remember that each host must have its applications in a different directory. You can find out more at Tomcat's documentation.

Trinidad.configure do |config|
  config.hosts = {
    # applications path (host app base directory) => host names
    # (first one is the "main" host name, other ones are aliases)
    '/var/www/local/apps' => ['localhost', '127.0.0.1'],
    '/home/trinidad/apps' => 'appshost'
    # NOTE: by default a (default) 'localhost' host is setup
  }
end

Detailed host configuration is also possible using supported host options :

---
  port: 8080
  hosts:
    localhost:
      app_base: /home/trinidad/apps
      auto_deploy: false
      unpackWARs: true

If applications are configured via the web_apps section, the host for each application can be added with the host (or hosts) key, if a specified host does not exists (e.g. not configured or not "localhost") it will be created. If several applications belong to the same host, they are expected to reside under the same parent directory e.g. :

Trinidad.configure do |config|
  config.web_apps = {
    :mock1 => {
      :root_dir => 'rails_apps/mock1',
      :host     => ['rails.virtual.host', 'rails.host']
    },
    :mock2 => {
      :root_dir => 'rails_apps/mock2',
      :host     => 'rails.virtual.host'
    },
    :mock3 => {
      :root_dir => 'rack_apps/mock3',
      :host     => ['rack.virtual.host', 'rack.host']
    }
  }
end

Extensions

Trinidad allows to extend itself with more (not just Tomcat) features using extensions, they're essentially components hooked into Tomcat's life-cycle. Here is a list of the available extensions that are "officially supported" :

You can find further information on how to write extensions in the wiki.

Support

Copyright

Copyright (c) 2016 Team Trinidad. See LICENSE (http://en.wikipedia.org/wiki/MIT_License) for details.

trinidad_scheduler_extension's People

Contributors

abrandoned avatar calavera avatar iaddict avatar kares avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

trinidad_scheduler_extension's Issues

Failing on startup

I am seeing an issue where Trinidad fails to startup because of a problem being raised in the scheduler extension which makes no sense to me. Below is the full log with backtrace of the error. And below that is the code for the scheduled job that is giving rise to the error.

2012-04-02 15:56:47 INFO: Set JAAS app name Tomcat
2012-04-02 15:56:47 INFO: Info: received max runtimes = 1
2012-04-02 15:56:47 INFO: jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (OpenJDK Server VM 1.6.0_20) [linux-i386-java]
2012-04-02 15:57:52 INFO: Info: received min runtimes = 1
2012-04-02 15:57:52 INFO: Info: received max runtimes = 1
2012-04-02 15:57:52 INFO: An exception happened during JRuby-Rack startup
can't convert nil into Hash
--- System
jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (OpenJDK Server VM 1.6.0_20) [linux-i386-java]
Time: 2012-04-02 11:57:52 -0400
Server: Apache Tomcat/7.0.23
jruby.home: /usr/local/jruby

--- Context Init Parameters:
jruby.compat.version = 1.9.2
jruby.initial.runtimes = 1
jruby.max.runtimes = 1
jruby.min.runtimes = 1
public.root = /public
rails.env = production
rails.root = /

--- Backtrace
TrinidadScheduler::ScheduledJob::JobError: can't convert nil into Hash
            included at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/trinidad_scheduler_extension-0.1.2/lib/trinidad_scheduler_extension/app_job.rb:9
             include at org/jruby/RubyModule.java:2118
            __send__ at org/jruby/RubyBasicObject.java:1704
                send at org/jruby/RubyKernel.java:2101
           inherited at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/trinidad_scheduler_extension-0.1.2/lib/trinidad_scheduler_extension/app_job.rb:64
              (root) at /var/apps/rails/refnet-admin/releases/20120402154700/app/jobs/cleanup_schedule.rb:3
             require at org/jruby/RubyKernel.java:1042
             require at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240
     load_dependency at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225
             require at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240
     require_or_load at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:348
           depend_on at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:302
  require_dependency at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:214
         eager_load! at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/railties-3.1.3/lib/rails/engine.rb:417
                each at org/jruby/RubyArray.java:1615
         eager_load! at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/railties-3.1.3/lib/rails/engine.rb:416
                each at org/jruby/RubyArray.java:1615
       eager_load_b_ at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/railties-3.1.3/lib/rails/engine.rb:414
            Finisher at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/railties-3.1.3/lib/rails/application/finisher.rb:51
       instance_exec at org/jruby/RubyBasicObject.java:1757
                 run at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/railties-3.1.3/lib/rails/initializable.rb:30
    run_initializers at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/railties-3.1.3/lib/rails/initializable.rb:55
                each at org/jruby/RubyArray.java:1615
    run_initializers at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/railties-3.1.3/lib/rails/initializable.rb:54
       initialize_b_ at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/railties-3.1.3/lib/rails/application.rb:96
            __send__ at org/jruby/RubyBasicObject.java:1698
                send at org/jruby/RubyKernel.java:2097
      method_missing at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30
              (root) at /var/apps/rails/refnet-admin/releases/20120402154700/config/environment.rb:5
             require at org/jruby/RubyKernel.java:1042
    load_environment at file:/var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/jruby-rack-1.1.4/lib/jruby-rack-1.1.4.jar!/jruby/rack/rails.rb:177
    load_environment at file:/var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/jruby-rack-1.1.4/lib/jruby-rack-1.1.4.jar!/jruby/rack/rails.rb:191
              (root) at /var/apps/rails/refnet-admin/releases/20120402154700/app/jobs/cleanup_schedule.rb:1
     create_takeover at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/trinidad-1.3.4/lib/trinidad/lifecycle/lifecycle_listener_host.rb:75
      check_monitors at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/trinidad-1.3.4/lib/trinidad/lifecycle/lifecycle_listener_host.rb:48
                each at org/jruby/RubyArray.java:1615
      check_monitors at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/trinidad-1.3.4/lib/trinidad/lifecycle/lifecycle_listener_host.rb:40
      lifecycleEvent at /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9/gems/trinidad-1.3.4/lib/trinidad/lifecycle/lifecycle_listener_host.rb:21

--- RubyGems
Gem.dir: /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9
Gem.path:
/var/apps/rails/refnet-admin/shared/bundle/jruby/1.9
/var/apps/rails/refnet-admin/releases/20120402154700/WEB-INF/gems
Activated gems:
  rake-0.9.2.2
  multi_json-1.0.4
  activesupport-3.1.3
  builder-3.0.0
  i18n-0.6.0
  activemodel-3.1.3
  erubis-2.7.0
  rack-1.3.6
  rack-cache-1.1
  rack-mount-0.8.3
  rack-test-0.6.1
  hike-1.2.1
  tilt-1.3.3
  sprockets-2.0.3
  actionpack-3.1.3
  mime-types-1.17.2
  polyglot-0.3.3
  treetop-1.4.10
  mail-2.3.0
  actionmailer-3.1.3
  bcrypt-ruby-3.0.1-java
  orm_adapter-0.0.5
  warden-1.1.0
  devise-1.5.3
  fastercsv-1.5.4
  formtastic-1.2.4
  has_scope-0.5.1
  responders-0.6.4
  inherited_resources-1.2.2
  rack-ssl-1.3.2
  json-1.6.3-java
  rdoc-3.12
  thor-0.14.6
  railties-3.1.3
  kaminari-0.13.0
  arel-2.2.1
  tzinfo-0.3.31
  activerecord-3.1.3
  polyamorous-0.5.0
  meta_search-1.1.1
  activeresource-3.1.3
  bundler-1.1.3
  rails-3.1.3
  sass-3.1.12
  activeadmin-0.3.4
  activerecord-jdbc-adapter-1.2.2
  jdbc-postgres-9.1.901
  activerecord-jdbcpostgresql-adapter-1.2.2
  acts_as_list-0.1.4
  xml-simple-1.1.1
  aws-s3-0.6.2
  bouncy-castle-java-1.5.0146.1
  cancan-1.6.7
  cocaine-0.2.1
  exception_notification-2.5.2
  execjs-1.2.13
  term-ansicolor-1.0.7
  foreman-0.30.1
  jruby-openssl-0.7.6.1
  jruby-rack-1.1.4
  mootools-rails-1.0.1
  paperclip-2.4.5
  rack-protection-1.2.0
  redis-2.2.2
  redis-namespace-1.0.3
  sinatra-1.3.2
  vegas-0.1.11
  resque-1.20.0
  ruby-mp3info-0.6.16
  sass-rails-3.1.5
  trinidad_jars-1.0.2
  trinidad-1.3.4
  trinidad_daemon_extension-0.3.0
  trinidad_resque_extension-0.1.1
  trinidad_scheduler_extension-0.1.2
  uglifier-1.2.0
  workflow-0.8.1
  zencoder-2.4.0

--- Bundler
Bundler.bundle_path: /var/apps/rails/refnet-admin/shared/bundle/jruby/1.9
Bundler.root: /var/apps/rails/refnet-admin/releases/20120402154700
Gemfile: /var/apps/rails/refnet-admin/releases/20120402154700/Gemfile
Settings:
  frozen = 1
  path = /var/apps/rails/refnet-admin/shared/bundle
  disable_shared_gems = 1
  without = development:test
  bin_path = /usr/local/src/jruby-1.6.7/lib/ruby/gems/1.8/gems/bundler-1.1.3/bin/bundle
  gemfile = /var/apps/rails/refnet-admin/releases/20120402154700/Gemfile

--- JRuby-Rack Config
compat_version = RUBY1_9
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = false
initial_runtimes = 1
jms_connection_factory = 
jms_jndi_properties = 
logger = org.jruby.rack.logging.ServletContextLogger@85cce9
logger_class_name = servlet_context
logger_name = jruby.rack
maximum_runtimes = 1
num_initializer_threads = 
rackup = 
rackup_path = 
rewindable = true
runtime_arguments = 
runtime_timeout_seconds = 
serial_initialization = false
servlet_context = org.apache.catalina.core.ApplicationContextFacade@14716c0
2012-04-02 15:57:52 SEVERE: unable to create shared application instance
2012-04-02 15:57:52 SEVERE: Error: application initialization failed
require 'fileutils'

class CleanupSchedule < TrinidadScheduler.Cron "42 1 * * ? *"
  def run
    date = DateTime.now.midnight - 1.day

    schedule_folder = File.join(Rails.root, 'tmp/streamer', date.strftime('%Y%m%d'))
    FileUtils.rm_rf(schedule_folder) if Dir.exists?(schedule_folder)
  end
end

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

from script/console run_later errors on nil.context_path

I seem to be missing something with how to run the TrinidadScheduler. I'm running trinidad_scheduler_extension(0.1.1) and trying to use the run_later method. Running in a jruby rails app I go into "rails console" and try the following:

begin
  TrinidadScheduler.run_later do
    _logger.info "I am inside this block" #=> prints "I am inside this block" 
  end
rescue => e
  puts e.message
end
# prints : undefined method `context_path' for nil:NilClass

First of all, one frustrating thing is that I can't get at the real exception since it's being wrapped by JobError. Wrapping like that looks like it swallows the original stack trace and only saves the original exception message.

It seems unclear what needs to be done here to define context (which is what I'm assuming context_path is attempting to be called on. Any suggestions? In my trinidad config I'm already setting context_path to "/".

Is not working? (new version)

I'm in need of configuration options for Quartz - as it is creating a number of threads and not disconnecting from my database -, then I cloned the git to use the latest version (0.2).

I see that https://github.com/trinidad/trinidad_scheduler_extension/blob/master/lib/trinidad_scheduler_extension.rb is missing a require 'trinidad_scheduler_extension/extensions/object'.
But besides this, I get this error:
undefined method 'schedule_job' for nil:NilClass
telling that the $servlet_context was not created.

I'm not familiar with developing extensions for Trinidad, I'm trying to understand why it is not set. If you could help.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Problem merging config opts with the default options

I'm running into a problem with a rails app when specifying the thread_count option in config/trinidad.yml
After some debugging, it seems like that the file is correctly read and the options are passed to the extension.
When I add some "logging" to trinidad_scheduler.rb#quartz_scheduler (line 99), it looks like the merging
goes sideways:

opts: {:thread_count=>3}
options: {:wrapped=>false, :thread_count=>10, :thread_priority=>5, :thread_count=>3}

Notice the duplicate key "thread_count". I couldn't reproduce this Hash#merge! behavior outside of
this gem, so this is likely not an issue with JRuby or Rails. Also tried using Hash#merge instead of merge!
without success.

Here's the relevant part of the trinidad.yml:

---
  ... other options
  extensions:
    scheduler:
      thread_count: 3

Environment:
rails 3.1.3
jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.7.0) Windows 7-amd64-java
(also reproduced the same issue on linux)
trinidad 1.3.4
trinidad_scheduler_extension 0.1.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.