Skip to content

Add a new server Railtie block: - #39953

Closed
Edouard-chin wants to merge 1 commit into
rails:masterfrom
Edouard-chin:ec-wip-server-blocks
Closed

Add a new server Railtie block:#39953
Edouard-chin wants to merge 1 commit into
rails:masterfrom
Edouard-chin:ec-wip-server-blocks

Conversation

@Edouard-chin

@Edouard-chin Edouard-chin commented Jul 30, 2020

Copy link
Copy Markdown
Member

Add a new server Railtie block:

  • This is similar to other railties blocks (such as console,
    tasks ...). The goal of this block is to allow the application
    or a railtie to load code after the server start.

    The use case can be to fire the webpack or react server in
    development or start some job worker like sidekiq or resque.

    Right now, all these tasks needs to be done in a separate
    shell and gem maintainer needs to add documentation on
    how to run their libraries if another program needs to run
    next to the Rails server.

    This feature can be used like this:

      class SuperRailtie < Rails::Railtie
        server do
          WebpackServer.run
        end
      end

cc/ @rafaelfranca @casperisfine

@rails-bot rails-bot Bot added the railties label Jul 30, 2020
@Edouard-chin Edouard-chin changed the title Allow a new server Railtie block: Add a new server Railtie block: Jul 30, 2020
@Edouard-chin
Edouard-chin force-pushed the ec-wip-server-blocks branch 2 times, most recently from 28dc8ae to 25b7b03 Compare August 3, 2020 13:16
- This is similar to other railties blocks (such as `console`,
  `tasks` ...). The goal of this block is to allow the application
  or a railtie to load code after the server start.

  The use case can be to fire the webpack or react server in
  development or start some job worker like sidekiq or resque.

  Right now, all these tasks needs to be done in a separate
  shell and gem maintainer needs to add documentation on
  how to run their libraries if another program needs to run
  next to the Rails server.

  This feature can be used like this:

  ```ruby
    class SuperRailtie < Rails::Railtie
      server do
        WebpackServer.run
      end
    end
  ```
@Edouard-chin
Edouard-chin force-pushed the ec-wip-server-blocks branch from 25b7b03 to 0bbfe0e Compare August 3, 2020 13:17
@Edouard-chin
Edouard-chin marked this pull request as ready for review August 3, 2020 13:17
@rails-bot

rails-bot Bot commented Nov 1, 2020

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant