simmsb / di-polysemy Goto Github PK
View Code? Open in Web Editor NEWSee README for more info
License: BSD 3-Clause "New" or "Revised" License
See README for more info
License: BSD 3-Clause "New" or "Revised" License
Hi! I just came across your article. Cool stuff! Thanks for sharing it!
I noticed there, however, a misuse of the new
function.
Essentially, di-polysemy
should not be using the new
function, nor trying to construct a Di
value at all. Instead, the various runXxx
functions in your library should take a Di
value as a parameter.
You can think of the Di
value as file handle or MVar
that will be accessed from multiple places in the application, possibly from different threads, with and without polysemy. If you construct a new Di
value each time diToIO
runs, then there's no guarantee that the log messages that are finally rendered to the outside world will happen in an absolute order, and if you attempt to log things from multiple threads you'll most definitely see log messages stepping on each other on stderr
or similar.
new
is expected to be used just once, in main
, as soon as the application starts, and the resulting Di
value should be given as argument to the various runXxx
functions, and to the logging functions such as info
, notice
, etc. It's perfectly safe to use this one Di
value, as is, from multiple threads.
As a convenience, to keep things simple in end-user applications (that is, in applications that depend on di-polysemy
), you'll probably want to call Di.new
from the di
package, which is a bit higher-level than Di.Core.new
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.