GithubHelp home page GithubHelp logo

Comments (7)

SreeniIO avatar SreeniIO commented on May 28, 2024

Cargo.toml

[package]
name = "quickjs_runtime"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.43"
futures = "0.3"
log = "0.4.11"
simple-logging = "2.0.2"
quickjs_runtime = "0.5.1"
hirofa_utils = "0.2.1"

from quickjs_es_runtime.

andrieshiemstra avatar andrieshiemstra commented on May 28, 2024

How do you prefer we deal with this? Just log and don't panic or prevent the context from dropping?

from quickjs_es_runtime.

SreeniIO avatar SreeniIO commented on May 28, 2024

How do you prefer we deal with this? Just log and don't panic or prevent the context from dropping?

I guess we should do similar to the thread dropping. Don't execute any code related to the context once the context is dropped.

Preventing the context from dropping?

Does it mean the runtime knows there are leaked promises during context drop? If so, throwing an error when trying to close a context with leaked promise would be even better.

from quickjs_es_runtime.

andrieshiemstra avatar andrieshiemstra commented on May 28, 2024

Well i'm currently working on the Runtime/Realm adapters in utils and i could rewrite it so Realm(context) has an Rc, when that RC is dropped the context will be dropped. A Promise/Function whatever adapter could have a clone of that Rc so the Realm(context) is actually only dropped when the last Promise is dropped.. allthough i fear this may cause a lot of unintended non-dropping Realms..

So i'm leaning toward just logging and not panicking...

from quickjs_es_runtime.

SreeniIO avatar SreeniIO commented on May 28, 2024

Agreed. In my case, it's the user code and we have no control over it. So there may be some promises that are left unresolved too.

from quickjs_es_runtime.

andrieshiemstra avatar andrieshiemstra commented on May 28, 2024

could you please check if 0.6.0 fixes this?

from quickjs_es_runtime.

SreeniIO avatar SreeniIO commented on May 28, 2024

Yes, it did. Thank you so much!

from quickjs_es_runtime.

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.