Coder Social home page Coder Social logo

Implement `read` builtin about moor HOT 4 CLOSED

rdaum avatar rdaum commented on September 2, 2024 1
Implement `read` builtin

from moor.

Comments (4)

rdaum avatar rdaum commented on September 2, 2024

In particular the problem here is how this fits with the I/O transaction model. Or doesn't. It's possible this one isn't going to happen, and will require core modifications to avoid.

from moor.

rdaum avatar rdaum commented on September 2, 2024

Thinking about this some more, it's really kind of a variant of suspend with the caveat that it needs the network host to take some action.

So two two things:

  1. Implement the flow on Session and back through the RPC layer: It should be a fork on the Session instance (just like suspend()) but followed by a channel event sent back to the client, requesting the input. And then the host should do the right thing to pull the input from the client.
  2. Transactional semantics, which are really the same as for suspend(); commit the current transaction ("world state") and start a new one.

from moor.

rdaum avatar rdaum commented on September 2, 2024

In any case the big caveat here is that just like with suspend, all bets are off on state / transactional consistency pre- and post- the read; there should be a big "buyer beware" message on both of those for verbs that use them, because they both introduce the potential for race conditions or messy state.

from moor.

rdaum avatar rdaum commented on September 2, 2024

Implemented in 813e0cb

As mentioned above: the read() invocation commits the current transaction, flushes the current I/O session buffer, and starts a new transaction for the post-read scenario.

from moor.

Related Issues (20)

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.