Giter Club home page Giter Club logo

Comments (5)

mhenrixon avatar mhenrixon commented on July 20, 2024 1

Good points! I'll get back to you with some thoughts when I have a clear and calm mind

from brpoplpush-redis_script.

mberlanda avatar mberlanda commented on July 20, 2024

I started to have a look to the configuration but the basing the configuration on a Concurrent::MutableStruct will restrict the scope of the improvement I was considering.

In particular, the latest version of its abstraction (https://github.com/ruby-concurrency/concurrent-ruby/blob/04e9390c4182049eb23a0cd736199fb17397d77c/lib/concurrent/synchronization/abstract_struct.rb) is not implementing the keyword_init behavior introduced in the ruby standard library (https://github.com/ruby/ruby/blob/58dfea0c8de29cbad35621847c04372b779c5f5d/struct.c#L483-L488).

What I may suggest is to let the user configure differently the SCRIPT_DIRECTORY coming up with something like:

RedisScript.configure do |config|
  config.add_scripts_path 'foo/bar'
  config.add_script :my_name, 'foo/bar/baz.lua'
end

RedisScript.configuration.script_paths # Concurrent::Hash
# {script_name1: file_path1, script_name2: file_path2}

After looking into the Brpoplpush::RedisScript::Template (in particular the partials feature) and the way the Brpoplpush::RedisScript::Client (script_path/script_source methods) this may be postponed we will really need this flexibility.

I assume moreover that:

  • we should preserve the benefits coming from Concurrent::MutableStruct
  • this change may introduce conflicts in the for files with the same name in different folders

from brpoplpush-redis_script.

mberlanda avatar mberlanda commented on July 20, 2024

Regarding the configuration I still have a doubt.
Assume that sidekiq_unique_jobs will you this gem setting a default SCRIPT_DIRECTORY, what would happen if I use this gem standalone for loading a custom folder in my project?
Would it conflixt with the configuration in my other dependency? If this is case, we should definitely add support for multiple paths since day 0 😄

from brpoplpush-redis_script.

mhenrixon avatar mhenrixon commented on July 20, 2024

I’ll show you exactly how to do this. Give me half an hour or so.

from brpoplpush-redis_script.

mhenrixon avatar mhenrixon commented on July 20, 2024

@mberlanda have a look at #12 please.

from brpoplpush-redis_script.

Related Issues (5)

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.