Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Stop simulators when there are no clients#205

Open
BrendanAnnable wants to merge 2 commits intomasterfrom
annable/lazy-simulators
Open

Stop simulators when there are no clients#205
BrendanAnnable wants to merge 2 commits intomasterfrom
annable/lazy-simulators

Conversation

@BrendanAnnable
Copy link
Member

@BrendanAnnable BrendanAnnable commented Sep 19, 2018

Stops my CPU from spinning while webpack is running but I have nothing open in the browser.

@BrendanAnnable BrendanAnnable temporarily deployed to nusight-pr-205 September 19, 2018 20:02 Inactive
}
},
{ fireImmediately: true },
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Remove duplication between prod.ts and dev.ts

}
},
{ fireImmediately: true },
)
Copy link
Member Author

@BrendanAnnable BrendanAnnable Sep 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uglier than needed I suspect. Perhaps VirtualRobots should instead expose a more flexible API that would be more suitable for reacting to an observable value.

Something like:

reaction(() => {
  () => now(frequency) && numConections > 0,
  enabled => enabled && virtualRobots.tick(),
  { fireImmediately: true },
})

Will try this later.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant