
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
ember-procrastination
Advanced tools
Did you know that almost no language implements procrastination primitives? Of
course, Java offers a ProcrastinationFactory
, .NET has System.Enterprise.ProcrastinationServices
and Haskell has that powerful Procrastinate
monad. However, to date no one has
ever implemented anything like this for Ember or JavaScript. Sad.
ember-procrastination introduces a new concurrency primitive called a someday
.
A someday
is a lot like a task
from ember-concurrency, but has the special
property that it will only schedule and do work when prompted several times.
This means that only work the user truly wants done will get completed. But be
careful: if you ask too much, it may get mad and cancel work already in-progress.
Such truly concurrent code can be finicky.
ember-procrastination also leverages the best in lazy code loading technology to
ensure that we don’t execute expensive operations until the last possible moment.
To do this, ember-procrastination uses an advanced Just-In-Time (JIT) feature
present in modern JavaScript: the beforeunload
event. When ember-procrastination
detects this event, all code that has been previously prompted to run that has
not yet been run will run, ensuring that all work is completed. And it all
happens concurrently. Amazing.
$ ember install ember-procrastination
controller.js:
import Ember from 'ember';
import { someday } from 'ember-procrastination';
import { timeout } from 'ember-concurrency';
export default Ember.Controller.extend({
regenerateNumber: someday(function* () {
this.set('num', Math.random());
yield timeout(1000);
})
});
template.hbs
<span>
Number is: {{num}}
</span>
<pre>
state = {{regenerateNumber.state}}
lastExcuse = {{regenerateNumber.lastExcuse}}
</pre>
<br />
<button
type="button"
disabled={{regenerateNumber.isRunning}}
onClick={{procrastinate regenerateNumber}}>
{{#if (and regenerateNumber.isProcrastinating regenerateNumber.lastExcuse)}}
{{regenerateNumber.lastExcuse}}
{{else if regenerateNumber.isRunning}}
Doing the thing...
{{else if regenerateNumber.isQueued}}
Ugh... Why do you keep asking me to do stuff?
{{else}}
Do the Thing
{{/if}}
</button>
git clone <repository-url>
this repositorycd ember-procrastination
npm install
ember serve
npm test
(Runs ember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit https://ember-cli.com/.
FAQs
No code is more concurrent than code that does not run.
The npm package ember-procrastination receives a total of 0 weekly downloads. As such, ember-procrastination popularity was classified as not popular.
We found that ember-procrastination demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.