You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

concurrent-ruby

Package Overview
Dependencies
Maintainers
3
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

concurrent-ruby - rubygems Package Compare versions

Comparing version
1.3.4
to
1.3.5
+12
-2
CHANGELOG.md
## Current
## Release v1.3.5, edge v0.7.2 (15 January 2025)
concurrent-ruby:
* (#1062) Remove dependency on logger.
concurrent-ruby-edge:
* (#1062) Remove dependency on logger.
## Release v1.3.4 (10 August 2024)

@@ -299,3 +309,3 @@

- Each object uses its own `SingleThreadExecutor` instead of the global thread pool.
- No longers supports executor injection
- No longer supports executor injection
- Much better documentation

@@ -475,3 +485,3 @@ * `Atom` updates

* Fixed bug when creating a `JavaThreadPoolExecutor` with minimum pool size of zero
* Removed confusing warning when not using native extenstions
* Removed confusing warning when not using native extensions
* Improved documentation

@@ -478,0 +488,0 @@

+2
-2

@@ -374,3 +374,3 @@ require 'concurrent/configuration'

#
# @raise [Concurrent::TimeoutError] when timout is reached
# @raise [Concurrent::TimeoutError] when timeout is reached
#

@@ -481,3 +481,3 @@ # @!macro agent_await_warning

#
# @raise [Concurrent::TimeoutError] when timout is reached
# @raise [Concurrent::TimeoutError] when timeout is reached
# @!macro agent_await_warning

@@ -484,0 +484,0 @@ def await_for!(timeout, *agents)

@@ -221,3 +221,3 @@ require 'concurrent/configuration'

#
# Instanciate a new object and ensure proper initialization of the
# Instantiate a new object and ensure proper initialization of the
# synchronization mechanisms.

@@ -224,0 +224,0 @@ #

@@ -116,3 +116,3 @@ require 'concurrent/atomic/atomic_reference'

# intended new value. The validator will return true if the new value
# is acceptable else return false (preferrably) or raise an exception.
# is acceptable else return false (preferably) or raise an exception.
#

@@ -119,0 +119,0 @@ # @!macro deref_options

@@ -1,2 +0,1 @@

require 'logger'
require 'concurrent/atomic/atomic_reference'

@@ -11,6 +10,8 @@

module Logging
include Logger::Severity
# The same as Logger::Severity but we copy it here to avoid a dependency on the logger gem just for these 7 constants
DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN = 0, 1, 2, 3, 4, 5
SEV_LABEL = %w[DEBUG INFO WARN ERROR FATAL ANY].freeze
# Logs through {Concurrent.global_logger}, it can be overridden by setting @logger
# @param [Integer] level one of Logger::Severity constants
# @param [Integer] level one of Concurrent::Concern::Logging constants
# @param [String] progname e.g. a path of an Actor

@@ -27,3 +28,3 @@ # @param [String, nil] message when nil block is used to generate the message

rescue => error
$stderr.puts "`Concurrent.configuration.logger` failed to log #{[level, progname, message, block]}\n" +
$stderr.puts "`Concurrent.global_logger` failed to log #{[level, progname, message, block]}\n" +
"#{error.message} (#{error.class})\n#{error.backtrace.join "\n"}"

@@ -38,4 +39,6 @@ end

# @return [Logger] Logger with provided level and output.
def self.create_simple_logger(level = Logger::FATAL, output = $stderr)
# Create a simple logger with provided level and output.
def self.create_simple_logger(level = :FATAL, output = $stderr)
level = Concern::Logging.const_get(level) unless level.is_a?(Integer)
# TODO (pitr-ch 24-Dec-2016): figure out why it had to be replaced, stdlogger was deadlocking

@@ -58,3 +61,3 @@ lambda do |severity, progname, message = nil, &block|

Time.now.strftime('%Y-%m-%d %H:%M:%S.%L'),
Logger::SEV_LABEL[severity],
Concern::Logging::SEV_LABEL[severity],
progname,

@@ -67,9 +70,11 @@ formatted_message

# Use logger created by #create_simple_logger to log concurrent-ruby messages.
def self.use_simple_logger(level = Logger::FATAL, output = $stderr)
def self.use_simple_logger(level = :FATAL, output = $stderr)
Concurrent.global_logger = create_simple_logger level, output
end
# @return [Logger] Logger with provided level and output.
# Create a stdlib logger with provided level and output.
# If you use this deprecated method you might need to add logger to your Gemfile to avoid warnings from Ruby 3.3.5+.
# @deprecated
def self.create_stdlib_logger(level = Logger::FATAL, output = $stderr)
def self.create_stdlib_logger(level = :FATAL, output = $stderr)
require 'logger'
logger = Logger.new(output)

@@ -101,3 +106,3 @@ logger.level = level

# @deprecated
def self.use_stdlib_logger(level = Logger::FATAL, output = $stderr)
def self.use_stdlib_logger(level = :FATAL, output = $stderr)
Concurrent.global_logger = create_stdlib_logger level, output

@@ -112,3 +117,3 @@ end

# @!visibility private
GLOBAL_LOGGER = AtomicReference.new(create_simple_logger(Logger::WARN))
GLOBAL_LOGGER = AtomicReference.new(create_simple_logger(:WARN))
private_constant :GLOBAL_LOGGER

@@ -115,0 +120,0 @@

@@ -22,3 +22,3 @@ require 'thread'

# reason are both `nil`. The first time the `#value` method is called the
# enclosed opration will be run and the calling thread will block. Other
# enclosed operation will be run and the calling thread will block. Other
# threads attempting to call `#value` will block as well. Once the operation

@@ -25,0 +25,0 @@ # is complete the *value* will be set to the result of the operation or the

@@ -86,3 +86,3 @@ require 'concurrent/utility/engine'

# pool will auto-prune each time a new job is posted. You will need to call
# this method explicitely in case your application post jobs in bursts (a
# this method explicitly in case your application post jobs in bursts (a
# lot of jobs and then nothing for long periods)

@@ -89,0 +89,0 @@

@@ -30,3 +30,3 @@ require 'concurrent/utility/engine'

# constantly monitored and restarted should it die. `SingleThreadExecutor`
# encapsulates all these bahaviors. The task processor is highly resilient
# encapsulates all these behaviors. The task processor is highly resilient
# to errors from within tasks. Also, should the thread die it will

@@ -33,0 +33,0 @@ # automatically be restarted.

@@ -151,3 +151,3 @@ require 'thread'

# re-check is done with get_or_default(key, NULL) instead of a simple !key?(key) in order to avoid a race condition, whereby by the time the current thread gets to the key?(key) call
# a key => value mapping might have already been created by a different thread (key?(key) would then return true, this elsif branch wouldn't be taken and an incorrent +nil+ value
# a key => value mapping might have already been created by a different thread (key?(key) would then return true, this elsif branch wouldn't be taken and an incorrect +nil+ value
# would be returned)

@@ -154,0 +154,0 @@ # note: nil == value check is not technically necessary

@@ -106,3 +106,3 @@ require 'thread'

# Promises are executed asynchronously from the main thread. By the time a
# child Promise finishes intialization it may be in a different state than its
# child Promise finishes initialization it may be in a different state than its
# parent (by the time a child is created its parent may have completed

@@ -109,0 +109,0 @@ # execution and changed state). Despite being asynchronous, however, the order

@@ -196,3 +196,3 @@ require 'concurrent/constants'

# The `delay` value given at instanciation.
# The `delay` value given at instantiation.
#

@@ -199,0 +199,0 @@ # @return [Float] the initial delay.

@@ -160,3 +160,3 @@ module Concurrent

members.each_with_index do |member, index|
clazz.send :remove_method, member if clazz.instance_methods.include? member
clazz.send :remove_method, member if clazz.instance_methods(false).include? member
clazz.send(:define_method, member) do

@@ -163,0 +163,0 @@ @values[index]

@@ -61,3 +61,3 @@ require 'concurrent/utility/native_extension_loader' # load native parts first

# volatile (Java) semantic as {.attr_volatile} does.
# The instance variable should be accessed oly through generated methods.
# The instance variable should be accessed only through generated methods.
# This method generates following methods: `value`, `value=(new_value) #=> new_value`,

@@ -64,0 +64,0 @@ # `swap_value(new_value) #=> old_value`,

@@ -12,3 +12,3 @@ require 'concurrent/thread_safe/util'

# A Ruby port of the Doug Lea's jsr166e.LondAdder class version 1.8
# A Ruby port of the Doug Lea's jsr166e.LongAdder class version 1.8
# available in public domain.

@@ -15,0 +15,0 @@ #

@@ -18,3 +18,3 @@ require 'concurrent/thread_safe/util'

# while true
# if (x = XorShiftRandom.xorshift).odd? # thread-localy generate a next random number
# if (x = XorShiftRandom.xorshift).odd? # thread-locally generate a next random number
# do_something_at_random

@@ -21,0 +21,0 @@ # end

module Concurrent
VERSION = '1.3.4'
VERSION = '1.3.5'
end

@@ -15,2 +15,4 @@ version = File.read("#{__dir__}/lib/concurrent-ruby/concurrent/version.rb")[/'(.+)'/, 1] or raise

ext.lib_dir = 'lib/concurrent-ruby/concurrent'
ext.source_version = '8'
ext.target_version = '8'
end

@@ -17,0 +19,0 @@

@@ -287,3 +287,3 @@ # Concurrent Ruby

If the library does not behave as expected, `Concurrent.use_stdlib_logger(Logger::DEBUG)` could
If the library does not behave as expected, `Concurrent.use_simple_logger(:DEBUG)` could
help to reveal the problem.

@@ -290,0 +290,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet