Understanding Promises in JavaScript (with yarn and Legos)

TL;DR: creating a Promise splits off another path of execution, and the Promise object represents the end of that path. Calling .then adds code to the end of that path. You can think of your program’s execution as following a piece of yarn. this video illustrates the difference between a synchronous program and the same program … Read moreUnderstanding Promises in JavaScript (with yarn and Legos)

Deference or Collaboration: pick one.

There’s this church near my house, with a statue of Mary Magdalene. She’s the picture of deference. As a child and as a Christian, I was raised to see deference as a virtue, to find this statue beautiful. As an adult and as a systems thinker, I learned that deference is dangerous. Nora Bateson pointed … Read moreDeference or Collaboration: pick one.

Automation story: GraphQL schema deployment

Building a new automation to give power to my team At Atomist, we supply a GraphQL endpoint to reveal links between commits, builds, deploys, and people. Internally, we also use GraphQL to access data in Neo4J. To do that, we need to deploy a schema definition (IDL) to the Neo4j GraphQL extension. Software evolves from simple … Read moreAutomation story: GraphQL schema deployment

Why does it work?

“Why” is too vague a question. Read my post on medium for the true-in-life half of this post. John Allspaw and the SNAFU catchers are studying incident retrospectives. People ask, “Why did this fail?” and you can learn a lot from that. In this talk my favorite bit is: ask “What made this not be worse?” Focus … Read moreWhy does it work?

Not “why”

“Why” is a terrible word because it’s overloaded. Often when we ask “why” we mean “for what purpose” — we’re looking for intention. In the bigger questions (bigger than one person’s decision), that doesn’t make sense. “Why do we let people buy those dangerous guns?”In a system the size of our country, there is no “for what … Read moreNot “why”

Reference: Typescript asynchronous sleep that returns a promise

I want some code to execute after a delay. I want to do this with promises, in TypeScript, asynchronously. Apparently this is hard. Here is the spell: const sleepPlease: (number) => Promise<void> =     promisify( (a, b) => setTimeout(b, a)); const slow: Promise<string> =     sleepPlease(500).then(() => “yay finally”);I imported promisify from “util”. setTimeout is … Read moreReference: Typescript asynchronous sleep that returns a promise