Skip to content

Instantly share code, notes, and snippets.

View skaegi's full-sized avatar

Simon Kaegi skaegi

  • IBM
  • Ottawa, Canada
View GitHub Profile
@skaegi
skaegi / gist:4694432
Last active December 12, 2015 01:58
Cancellation/A+ - Draft D

Cancellation/A+

This proposal specifies how cancellation is triggered and handled in a Promises/A+ library. Cancellation support is optional and provides a mechanism for a promise consumer to signal that further work on fulfilling should be stopped. Cancellation is modeled as rejection with a specified "Cancel" Error signature.

Terminology

In addition to the terminology from Promises/A+ we use the following:

  1. CancelException is an error used to reject cancelled promises.
  2. "direct cancellation" is what occurs when a pending promise is cancelled by the consumer of a promise by calling cancel
@skaegi
skaegi / gist:4736504
Last active December 12, 2015 07:28
Promises A+ - Cancel Tests
/*global describe specify require global*/
"use strict";
var assert = require("assert");
var adapter = global.adapter;
var fulfilled = adapter.fulfilled;
var rejected = adapter.rejected;
var pending = adapter.pending;
// HOWTO: load LABjs itself dynamically!
// inline this code in your page to load LABjs itself dynamically, if you're so inclined.
(function (global, oDOC, handler) {
var head = oDOC.head || oDOC.getElementsByTagName("head");
function LABjsLoaded() {
// do cool stuff with $LAB here
}
@skaegi
skaegi / volumes.yaml
Last active November 6, 2019 03:48 — forked from bobcatfish/volumes.yaml
Example using generated workspace subpaths and interpolation to retrieve the value, absolute paths in the Tasks, two separate workspaces instead of the hierarchical mailbox workspace
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: make-stuff
spec:
params:
- name: message
steps:
- name: doit
image: alpine
apiVersion: v1
kind: Pod
metadata:
name: hello20
spec:
restartPolicy: Never
containers:
- name: echo1
image: busybox:1.31.1
command:
@skaegi
skaegi / 20-hello-task.yaml
Created November 21, 2019 18:49
20-step-test
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: 20echo-hello-world
spec:
steps:
- name: echo1
image: busybox:1.31.1
command:
- echo
@skaegi
skaegi / K8s-Raw-Block-Kata.md
Created October 14, 2020 04:53 — forked from amshinde/K8s-Raw-Block-Kata.md
K8s Raw Block storage support with Kata
@skaegi
skaegi / testcase-nested-base.yaml
Created November 29, 2021 03:23
Nested data volume test cases -- base, kata using runtimeClass, kata using untrusted annotation
apiVersion: v1
data:
config: my config
kind: ConfigMap
metadata:
name: config
---
apiVersion: v1
data:
config: more config