Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Latest commit

 

History

History
34 lines (22 loc) · 973 Bytes

README.rdoc

File metadata and controls

34 lines (22 loc) · 973 Bytes

tengine_rails_plugin example

Install

Just now, you have to install the gems manually.

$ git clone git://github.com/tengine/tengine.git
$ cd tengine
$ rake spec
$ rake rebuild
$ gem i tengine_support/pkg/tengine_support-1.1.0.alpha1.gem 
$ gem i tengine_event/pkg/tengine_event-1.1.0.alpha1.gem 
$ gem i tengine_core/pkg/tengine_core-1.1.0.alpha1.gem

Start

  1. Start MongoDB

  2. Start RabbitMQ

  3. Terminal A

    $ bundle exec rails s

  4. Terminal B

    $ BUNDLE_GEMFILE=Gemfile-tengined bundle exec tengined -f config/tengined.yml.erb

When you create a new Product record, the Product record fires an event for tengine. Then tengined kicks the event handlder for tengine.example.on_create in app/tenigned/product_handler.rb.

Test it

  1. open localhost:3000/products

  2. create new product

  3. open localhost:3000/product_logs and see a log created.

  4. open localhost:3000/tengine/batches and see a batch logs.