You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the fittings are produced by a synchronous factory.
The factory is provided with fcty(fittingDef, bagpipes).
I would like to be able to introduce fittings that employ asynchronous initiation, and should be able to fail fast in the meaning of stop the process gracefully if any of their data-sources are not available.
A simplified example:
my-paramount-must-be-init-dal initiates itself with a map of values, and subscribes to a channel to be notified whenever they change. outside of it, any access to this map of values is synchronous.
The data-source and the subscription channels, are provided in fittingDef.dalCfg
constdal=require('./my-paramount-must-be-init-dal');module.exports=myFittingFactory(fittingDef,bagpipes,cb){dal.init(fittingDef.dalCfg,function(err){if(err)returncb(err);cb(null,{get: (id,cb)=>cb(null,dal.repo[id])})//not a mistake. sync access to object key})}
To do this without asycn loading of the fitting I have to implement a deferring mechanism to each of the featured dal methods - and that's annoying... :/
The text was updated successfully, but these errors were encountered:
Currently, the fittings are produced by a synchronous factory.
The factory is provided with
fcty(fittingDef, bagpipes)
.I would like to be able to introduce fittings that employ asynchronous initiation, and should be able to fail fast in the meaning of stop the process gracefully if any of their data-sources are not available.
A simplified example:
my-paramount-must-be-init-dal
initiates itself with a map of values, and subscribes to a channel to be notified whenever they change. outside of it, any access to this map of values is synchronous.The data-source and the subscription channels, are provided in
fittingDef.dalCfg
To do this without asycn loading of the fitting I have to implement a deferring mechanism to each of the featured dal methods - and that's annoying... :/
The text was updated successfully, but these errors were encountered: