vert-x3 / vertx-lang-ruby

Vert.x Ruby support
Apache License 2.0
14 stars 12 forks source link

Option to have shared (non-isolated) verticle deployments #24

Closed mmindenhall closed 2 years ago

mmindenhall commented 7 years ago

Copied from groups discussion thread:

In early 2015 my company ported a large REST API platform from Sinatra/Rails to vert.x 2 (and subsequently to vert.x 3 earlier this year).

Our initial 2.x port had everything running in a single verticle. Later, we started splitting some functionality out into separate verticles, and noticed that for each verticle, we had to have a ruby 'require' statement on any ruby file used in the verticle (that was not needed in the Sinatra/Rails monolith). We assumed this was due the vert.x 2 "verticle isolation", where each verticle was loaded with a separate class loader.

After porting to vert.x 3, we expected that to change (i.e., expected the following to work):

  1. main verticle has a require for api.rb
  2. api.rb executes many other require statements, basically loading all shared code, initializing routes, etc.
  3. subsequent verticles loaded after main verticle would not need to 'require' anything already loaded by main verticle

If possible, we would like to have a configuration option that would allow us to deploy verticles in this way (with the understanding that we will need to explicitly manage the verticle deployment order).