GithubHelp home page GithubHelp logo

Issues with thin 1.5.0? about dashing HOT 3 CLOSED

shopify avatar shopify commented on June 9, 2024
Issues with thin 1.5.0?

from dashing.

Comments (3)

pushmatrix avatar pushmatrix commented on June 9, 2024

Not sure why this would be happening. For my own dashboards, I'm running OSX Lion with ruby 1.9.3-p194 without problems, and I'm loading in tons of libraries and jobs.

Might sound silly, but are you loading any libraries inside of adder.rb, or are you doing anything computationally expensive? If adder.rb is empty, does it still do the same?

from dashing.

tommasop avatar tommasop commented on June 9, 2024

Here is my adder.rb code

(1..1000).each do |a|
  system `echo "#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{Time.now}" >> C:/Users/winmais/code/anas_dashboard/fake_data`
  sleep(0.2)
end

If I move adder.rb in the dashing root folder there is no problem.

from dashing.

pushmatrix avatar pushmatrix commented on June 9, 2024

The lib directory is not meant to run code, but rather to supply helper methods & classes for your jobs. If you have any executable code in there, it will run as soon as Dashing starts. Since you're calling sleep 1000 times, that would explain the slow load.

Placing adder.rb in your root folder won't cause a problem because the file won't be loaded/run. The only autoload paths are in jobs & lib.

If you want to do something every 0.2 seconds, your best bet is to use jobs. Each job is threaded, so you can do more expensive stuff in there.

jobs/adder.rb
SCHEDULER.every '0.2s', :first_in => 0 do
  system `echo "#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{Time.now}" >> C:/Users/winmais/code/anas_dashboard/fake_data`
end

from dashing.

Related Issues (20)

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.