Skip to content

2.0 Some Specific Technical Changes #542

@jdantonio

Description

@jdantonio

Concurrent Ruby 1.0 has been very successful, but we made some mistakes along the way. We had a few ideas that didn't work out as well as we had hoped. We discovered that some features were more trouble than they were worth. And we gained a better understanding of what our users want. Based on this learning we will make several specific changes while designing and building 2.0.

  • Remove the Dereferenceable module: This was an experiment in mimicking the immutability of functional languages. It added complexity and didn't solve the problem. We're simply going to remove it and deprecate its features.
  • No autoload: We adopted autoload from two separate gems that we merged in. It worked much better in those smaller, more focussed gems. We won't use autoload in 2.0.
  • Explicit require: Creating one file with a bunch of require statements for loading the entire gem was problematic in 1.0. Because we eat our own dog food we ran into issues with the load order. In 2.0 every file will explicitly require every file it depends on. This is one case where will be non-idiomatic and instead mimic Java and C#.
  • Require only what is necessary: Many of our biggest users only need a small portion of concurrent-ruby. Being forced to require the entire gem imposes an unnecessary and unwanted memory and load-time dependency. Users should be able to load only the parts that they need.
  • No global config: Allowing users to change the global configuration was a mistake. In a large project where multiple gems all depend on concurrent-ruby, changing the global config can cause serious side effects. In 2.0 we will remove the ability to change the global configuration. We will support dependency injection and inversion of control instead when necessary.
  • One global thread pool: Creating a "fast" thread pool and an "io" thread pool was a mistake. The "fast" thread pool is of no value on MRI ruby. It's inclusion has caused confusion with our users while providing no benefit. For convenience we will still provide a factory method to create a thread pool with these characteristics, but that's it. We'll have one and only one global thread pool that is optimized for Concurrent I/O operations and it will be the default thread pool for everything. We will remove all convenience features for the "fast" vs. "io" thread pools, remove all methods which explicitly use the "fast" thread pool, and rename the global "io" pool to simply the "global thread pool" or "global executor".

Metadata

Metadata

Assignees

No one assigned

    Labels

    designPlaceholder issues for more general design discussions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions