Coder Social home page Coder Social logo

cloning-and-transfering's Introduction

cloning-and-transfering's People

Contributors

domenic avatar

Watchers

 avatar  avatar  avatar

cloning-and-transfering's Issues

Some IRC logs

annevk> Domenic_: where should we track structured cloning for promises?
14:10:07 <annevk> Domenic_: as part of https://github.com/dslomov-chromium/ecmascript-structured-clone maybe?
14:48:45 <sicking> annevk, Domenic_: So the idea is a Promise subclass which when you resolve(x) it would structured clone x?
14:49:40 <sicking> annevk, Domenic_: Oh, or would each then-handler (sorry, i forget the correct vocabulary) receive a separate structured clone of 'x'?
14:54:13 <sicking> oh oh
14:54:29 <sicking> such a Promise would then itself be structured-clonable
14:54:39 <sicking> i.e. you could pass such a Promise to a worker
14:54:48 <sicking> even before it is resolved
14:54:57 <sicking> and when it is resolved the value appears in the worker
14:55:02 <sicking> that would be awesome!
14:55:25 <sicking> a pain to implement, but a delight to use
14:55:56 <sicking> and not any harder to implement than transferrable streams will be
14:56:53 <annevk> yeah, you want to clone the promise
14:56:57 <annevk> or transfer it maybe
14:57:09 <sicking> cloning is enough
14:57:32 <sicking> we could do the transfer for the same reason that we could do transfers of JS objects though
15:00:29 <sicking> something that would be interesting though is a Promise which you could pass to another thread, and when you resolve the promise, the value is *transferred* (rather than cloned) to the other thread
15:02:11 <sicking> the tricky thing with that is what happens if the Promise has multiple registered then-handlers. That would not really work
15:02:25 <sicking> actually... it kind'a would
15:03:13 <annevk> if you transfer the promise it could reject in the original thread
15:03:20 <sicking> exactly
15:13:11 <sicking> so far has TC39 gotten in enabling structured clones to be extensible?
15:16:24 <annevk> i don't think they have yet
15:16:28 <annevk> but people have ideas apparently
15:16:45 <annevk> https://github.com/dslomov-chromium/ecmascript-structured-clone is what I wrote with dslomov
15:16:52 <annevk> but that's mostly what HTML had
15:16:55 <annevk> has*
15:20:22 <sicking> oh, and that doesn't make it extensible
15:26:23 <annevk> right
15:26:30 <annevk> that was going to be a later step
15:26:38 <annevk> first get TC39 to embrace the concept in the first place
15:27:13 <annevk> JavaScript is bigger than the browser and therefore things we do are not automatically accepted...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.