Giter Site home page Giter Site logo

Dynamic options about eris HOT 3 CLOSED

fnuecke avatar fnuecke commented on May 28, 2024
Dynamic options

from eris.

Comments (3)

SirVer avatar SirVer commented on May 28, 2024

I would prefer to have a persist_with_perms(perms, table, options) method instead of having perms being mandatory or overloading persist()s first parameter in any way.

from eris.

fnuecke avatar fnuecke commented on May 28, 2024

I agree that the mandatory perms part sucks. I'm thinking an alternative might be to just store the options in the registry (and possibly copy them to the info structs used when persisting/unpersisting for performance). So there'd be one more function, eris.settings([table]) - or a couple of getters/setters. On the C side I imagine passing the argument via the Lua stack might also be nice, to avoid having more functions for configuring than for persisting...

from eris.

fnuecke avatar fnuecke commented on May 28, 2024

Some notes:

  • all settings are stored in the registry (if set), so they will be separate for different Lua states but shared among all coroutines; I think this is a good compromise between implementation complexity and context isolation.
  • all settings can be changed from the Lua side. Create a wrapper with the original function as a local variable / upvalue to control access - although that's probably an unlikely scenario, since you'd never want to expose Eris to unsafe code, because eris.unpersist() is utterly unsafe as it can load compiled byte code (function prototypes).

Also, if someone finds data-structures that segfault with the default value of maxrec, please let me know (and also let me know the highest safe value so this can be made the new default). Thanks.

from eris.

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.