Skip to content

Instantly share code, notes, and snippets.

View amb26's full-sized avatar

Antranig Basman amb26

View GitHub Profile
fluid.preExpandRecurse = function (root, source, holder, member) { // on entry, holder[member] = source
function pushExpander(expander) {
root.expanders.push({expander: expander, holder: holder, member: member});
delete holder[member];
};
if (fluid.isIoCReference(source)) {
var parsed = fluid.parseContextReference(source);
var segs = fluid.model.parseEL(parsed.path);
pushExpander({
func: fluid.expander.fetch,
title Model Relay
layout default
category Infusion

The Infusion Model Relay system is a powerful scheme for supplying declarative configuration which specifies rules for keeping multiple pieces of model state around the component tree automatically up to date with each other's changes. We sometimes use the term model skeleton to refer to a connected set of models around the component tree which are related together by relay rules. This appeals to the idea that these models form an inner core which arrive at a set of mutually consistent model values, before they start to notify listeners out in the periphery of each component (generally, in its view layer). The system might make several passes over the model skeleton in order to satisfy all the relay rules, and then update all modelListeners as a single operation — presenting them with a consistent snapshot of the state of the entire

title Priorities
layout default
category API

Many elements of an Infusion application (in particular, Listeners, Model Listeners, Options Distributions and Subcomponents ) allow the use of a standardised entry named priority which allows the position of that element within a list of such elements to be adjusted. Depending on what the element is, the effect of the priority will be different — for example, a listener may be notified earlier or later than another

Kettle

Kettle is an integration technology which promotes the expression of servers handling HTTP and WebSockets endpoints. With a few exceptions, Kettle implements no primary functionality of its own, but aggregates the facilities of express and ws, as well as middleware held in the wider pillarjs "Bring your own HTTP Framework Framework" ecosystem. Kettle applications can easily incorporate any express-standard middleware, as well as coexisting with standard express apps targeted at the same node.js http.Server. Since Kettle applications are expressed declaratively, in the JSON format encoding Infusion's component trees, it is possible to adapt existing applications easily, as well as inserting middleware and new handlers anywhere in the pipeline without modifying the original application's

@amb26
amb26 / gist:42c108ee5c46566ed1bc
Created July 2, 2015 11:58
FluidIoC.js diff from FLUID-5249 to master
diff --git a/src/framework/core/js/FluidIoC.js b/src/framework/core/js/FluidIoC.js
index e1c13fa..70fb7f7 100644
--- a/src/framework/core/js/FluidIoC.js
+++ b/src/framework/core/js/FluidIoC.js
@@ -1,6 +1,6 @@
/*
Copyright 2011-2013 OCAD University
-Copyright 2010-2011 Lucendo Development Ltd.
+Copyright 2010-2015 Lucendo Development Ltd.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3: Pie layout</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<style type="text/css">
svg text {
font-family: sans-serif;
@amb26
amb26 / server-part.js
Created August 3, 2015 18:17
Kettle's upcoming server's oncreate
"onCreate.setLogging": {
funcName: "fluid.setLogging",
args: "{that}.options.logging"
},
"onCreate.registerMiddleware": {
funcName: "kettle.server.registerMiddleware",
args: "{that}",
priority: "after:setLogging"
},
"onCreate.registerHandlers": {
fluid.defaults("kettle.requests", {
gradeNames: ["fluid.component"],
events: {
createRequest: null // fired by our handler once express determines that route + verb is a match
},
dynamicComponents: {
request: {
createOnEvent: "createRequest",
type: "{arguments}.3.type",
options: {
fluid.computeDynamicComponents = function (that, mergeOptions) {
var shadow = fluid.shadowForComponent(that);
var localSub = shadow.subcomponentLocal = {};
var records = fluid.driveStrategy(that.options, "dynamicComponents", mergeOptions.strategy);
fluid.each(records, function (record, recordKey) {
if (!record.sources && !record.createOnEvent) {
fluid.fail("Cannot process dynamicComponents record ", record, " without a \"sources\" or \"createOnEvent\" entry");
}
if (record.sources) {
var sources = fluid.expandOptions(record.sources, that);
fluid.prettyPrintJSON(fluid.defaults("berg.test.scheduler.offlineTestSequencer"))
"{
"gradeNames": [
"berg.test.scheduler.offlineTestSequencer",
"berg.test.scheduler.testSequencer",
"fluid.modelComponent",
"fluid.component",
"berg.test.scheduler.testSequencer.offline"
],
"listeners": {