These are chat archives for StephanHoyer/mithril-isomorphic-example

15th
Dec 2015
Stephan Hoyer
@StephanHoyer
Dec 15 2015 16:03
@grumpi I think your code has the problem of leaking data between requests.
all requests share a namespace between each other
if all users will get the same result a solution might be to bind the content of the continuation-local-storage to the URL
that way the data is the right one at least for each request
but still every user gets the same data for the same url
if that's no problem, you're fine I think
if not you have to take the express-request into account
which is a little harder to accomplish I think
sabine
@sabine
Dec 15 2015 16:59
hm, I think that's a good point to investigate. I'm not 100% sure how the continuation-local-storage thing works. And if it indeed just acts like a key-value-store (with the names of the storages being the keys) it won't work this way.
sabine
@sabine
Dec 15 2015 17:09
"Continuation-local storage works like thread-local storage in threaded programming" from https://github.com/othiym23/node-continuation-local-storage makes me think it
is separate for every callchain started with .run()
will do some experiments to see if that's the case
sabine
@sabine
Dec 15 2015 17:56
Ok, randomly delaying the load() calls so that they get interleaved between different requests on the server doesn't mix up the continuation-local-storages.
sabine
@sabine
Dec 15 2015 18:02
This plus all the slides on continuation-local-storage describing similar scenarios as use-case make me feel reasonably confident that it works the way I thought.