repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/examples/pool.rb | examples/pool.rb | #!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../lib", __dir__)
require "celluloid/autostart"
# This is required for pool to work as Celluloid doesn't load it by default
require "celluloid/pool"
require "prime"
class PrimeWorker
include Celluloid
# Checks if a number is prime
def prime(number)
pu... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/examples/futures.rb | examples/futures.rb | #!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../lib", __dir__)
require "celluloid/autostart"
require "digest/sha2"
class Hasher
include Celluloid
def initialize(secret)
@hash = Digest::SHA2.hexdigest(secret)
end
# Add some data into our hash. This demonstrates a non-trivial computation
# of t... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/examples/supervisors_and_registry.rb | examples/supervisors_and_registry.rb | require "celluloid/autostart"
class MyActor
include Celluloid
attr_reader :state
def initialize
@state = :clean
end
def broken_method
@state = :dirty
oh_crap_im_totally_broken
end
end
#
# Using the Supervisor API directly
#
puts "*** Demonstrating using the Supervisor API directly"
# Calli... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/examples/ring.rb | examples/ring.rb | #!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../lib", __dir__)
require "celluloid/autostart"
class Ring
include Celluloid
class Node
include Celluloid
def initialize(link)
@link = link
end
def around(n)
@link.async.around n
end
end
def initialize(size)
@node = ... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/examples/stack.rb | examples/stack.rb | #!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../lib", __dir__)
require "celluloid/autostart"
# This example builds on basic_usage.rb to show two things about #async: the
# (new) fluent API and the preservation of causality order.
class Stack
include Celluloid
attr_reader :ary
def initialize
@ary ... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/examples/basic_usage.rb | examples/basic_usage.rb | #!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../lib", __dir__)
require "celluloid/autostart"
class Counter
# This is all you have to do to turn any Ruby class into one which creates
# Celluloid actors instead of normal objects
include Celluloid
# Now just define methods like you ordinarily would
a... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/examples/timers.rb | examples/timers.rb | #!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../lib", __dir__)
require "celluloid"
class TimerExample
include Celluloid
attr_reader :fired, :timer
def initialize
@fired = false
@timer = after(3) { puts "Timer fired!"; @fired = true }
end
end
#
# Basic timer example
#
actor = TimerExample.n... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/examples/simple_pmap.rb | examples/simple_pmap.rb | #!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../lib", __dir__)
require "celluloid/autostart"
module Enumerable
# Simple parallel map using Celluloid::Futures
def pmap(&block)
futures = map { |elem| Celluloid::Future.new(elem, &block) }
futures.map(&:value)
end
end
p 100.times.pmap { |n| n * 2 ... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid.rb | lib/celluloid.rb | # TODO: eliminate use of global variables
require "English"
require "logger"
require "set"
require "timeout"
# !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
# rubocop:disable Style/GlobalVars
$CELLULOID_MONITORING = false
# rubocop:enable Style/GlobalVars
require "celluloid/version"
module Celluloid
# Expo... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/test.rb | lib/celluloid/test.rb | # !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
# rubocop:disable Style/GlobalVars
$CELLULOID_TEST = true
# rubocop:enable Style/GlobalVars
#
require "celluloid/autostart"
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/task.rb | lib/celluloid/task.rb | module Celluloid
# Tasks are interruptable/resumable execution contexts used to run methods
class Task
# Obtain the current task
def self.current
Thread.current[:celluloid_task] || raise(NotTaskError, "not within a task context")
end
# Suspend the running task, deferring to the scheduler
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/calls.rb | lib/celluloid/calls.rb | module Celluloid
# Calls represent requests to an actor
class Call
attr_reader :method, :arguments, :block
def initialize(method, arguments = [], block = nil)
@retry = 0
@method = method
@arguments = arguments
if block
if Celluloid.exclusive?
# FIXME: nicer excepti... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/probe.rb | lib/celluloid/probe.rb | require "celluloid"
# !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
# rubocop:disable Style/GlobalVars
$CELLULOID_MONITORING = true
# rubocop:enable Style/GlobalVars
module Celluloid
class Probe
include Celluloid
include Celluloid::Notifications
NOTIFICATIONS_TOPIC_BASE = "celluloid.events.%s".f... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/version.rb | lib/celluloid/version.rb | module Celluloid
VERSION = "0.18.0".freeze
end
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/thread.rb | lib/celluloid/thread.rb | module Celluloid
class Thread < ::Thread
def celluloid?
true
end
attr_accessor :busy
# Obtain the role of this thread
def role
self[:celluloid_role]
end
def role=(role)
self[:celluloid_role] = role
end
# Obtain the Celluloid::Actor object for this thread
d... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/exceptions.rb | lib/celluloid/exceptions.rb | module Celluloid
class Error < StandardError; end
class Interruption < RuntimeError; end
class TimedOut < Celluloid::Interruption; end # Distinguished from `Timeout`
class StillActive < Celluloid::Error; end
class NotActive < Celluloid::Error; end
class NotActorError < Celluloid::Error; end # Don't do Actor... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision.rb | lib/celluloid/supervision.rb | require "celluloid" unless defined? Celluloid
require "celluloid/supervision/constants"
require "celluloid/supervision/supervise"
require "celluloid/supervision/container"
require "celluloid/supervision/container/instance"
require "celluloid/supervision/container/behavior"
require "celluloid/supervision/container/inj... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/group.rb | lib/celluloid/group.rb | module Celluloid
class Group
attr_accessor :group
def initialize
@pid = $PROCESS_ID
@mutex = Mutex.new
@group = []
@running = true
end
def assert_active
raise Celluloid::NotActive unless active?
end
def assert_inactive
return unless active?
if RUBY_... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/cell.rb | lib/celluloid/cell.rb | module Celluloid
OWNER_IVAR = :@celluloid_owner # reference to owning actor
# Wrap the given subject with an Cell
class Cell
class ExitHandler
def initialize(behavior, subject, method_name)
@behavior = behavior
@subject = subject
@method_name = method_name
end
def c... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/core_ext.rb | lib/celluloid/core_ext.rb | class Thread
attr_accessor :uuid_counter, :uuid_limit
def celluloid?
false
end
end
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/pool.rb | lib/celluloid/pool.rb | require "celluloid" unless defined? Celluloid
require "celluloid/supervision"
require "celluloid/supervision/container/pool"
require "celluloid/supervision/container/behavior/pool"
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/proxies.rb | lib/celluloid/proxies.rb | module Celluloid
module Proxy
require "celluloid/proxy/abstract"
require "celluloid/proxy/sync"
require "celluloid/proxy/cell"
require "celluloid/proxy/actor"
require "celluloid/proxy/async"
require "celluloid/proxy/future"
require "celluloid/proxy/block"
end
end
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/autostart.rb | lib/celluloid/autostart.rb | require "celluloid"
Celluloid.boot
# !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
# rubocop:disable Style/GlobalVars
Celluloid.register_shutdown unless defined?($CELLULOID_TEST) && $CELLULOID_TEST
# rubocop:enable Style/GlobalVars
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/logging.rb | lib/celluloid/logging.rb | require "celluloid/logging/log_event"
require "celluloid/logging/incident"
require "celluloid/logging/ring_buffer"
require "celluloid/logging/incident_logger"
require "celluloid/logging/incident_reporter"
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/future.rb | lib/celluloid/future.rb | module Celluloid
# Celluloid::Future objects allow methods and blocks to run in the
# background, their values requested later
class Future
def self.new(*args, &block)
return super unless block
future = new
# task = Thread.current[:celluloid_task]
# actor = Thread.current[:celluloid_a... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/actor.rb | lib/celluloid/actor.rb | require "timers"
module Celluloid
# Actors are Celluloid's concurrency primitive. They're implemented as
# normal Ruby objects wrapped in threads which communicate with asynchronous
# messages.
class Actor
attr_reader :behavior, :proxy, :tasks, :links, :mailbox, :thread, :name, :timers
attr_writer :exi... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/mailbox.rb | lib/celluloid/mailbox.rb | module Celluloid
class MailboxDead < Celluloid::Error; end # you can't receive from the dead
class MailboxShutdown < Celluloid::Error; end # raised if the mailbox can no longer be used
# Actors communicate with asynchronous messages. Messages are buffered in
# Mailboxes until Actors can act upon them.
class ... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/rspec.rb | lib/celluloid/rspec.rb | require "celluloid/test"
module Specs
CHECK_LOOSE_THREADS = false
ALLOW_RETRIES = 3 unless defined? ALLOW_RETRIES
INCLUDE_SUPPORT = %w[
logging
sleep_and_wait
reset_class_variables
crash_checking
loose_threads
stubbing
coverage
includer
configure_rspec
].freeze
INCLUDE_P... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/notifications.rb | lib/celluloid/notifications.rb | module Celluloid
module Notifications
def self.notifier
Actor[:notifications_fanout] || raise(DeadActorError, "notifications fanout actor not running")
end
def publish(pattern, *args)
Celluloid::Notifications.notifier.publish(pattern, *args)
rescue DeadActorError
# Bad shutdown logi... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/system_events.rb | lib/celluloid/system_events.rb | module Celluloid
class Actor
# Handle high-priority system event messages
def handle_system_event(event)
if handler = SystemEvent.handle(event.class)
send(handler, event)
else
Internals::Logger.debug "Discarded message (unhandled): #{message}"
end
end
end
# High-prior... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/condition.rb | lib/celluloid/condition.rb | module Celluloid
# ConditionVariable-like signaling between tasks and threads
class Condition
class Waiter
def initialize(condition, task, mailbox, timeout)
@condition = condition
@task = task
@mailbox = mailbox
@timeout = timeout
end
attr_reader :condition, :ta... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/proxy/cell.rb | lib/celluloid/proxy/cell.rb | # A proxy object returned from Celluloid::Actor.new/new_link which converts
# the normal Ruby method protocol into an inter-actor message protocol
class Celluloid::Proxy::Cell < Celluloid::Proxy::Sync
def initialize(mailbox, actor_proxy, klass)
super(mailbox, klass)
@actor_proxy = actor_proxy
@async_prox... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/proxy/sync.rb | lib/celluloid/proxy/sync.rb | # A proxy which sends synchronous calls to an actor
class Celluloid::Proxy::Sync < Celluloid::Proxy::AbstractCall
def respond_to?(meth, include_private = false)
__class__.instance_methods.include?(meth) || method_missing(:respond_to?, meth, include_private)
end
def method_missing(meth, *args, &block)
rai... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/proxy/future.rb | lib/celluloid/proxy/future.rb | # A proxy which creates future calls to an actor
class Celluloid::Proxy::Future < Celluloid::Proxy::AbstractCall
def method_missing(meth, *args, &block)
raise ::Celluloid::DeadActorError, "attempted to call a dead actor: #{meth}" unless @mailbox.alive?
if block_given?
# FIXME: nicer exception
rai... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/proxy/actor.rb | lib/celluloid/proxy/actor.rb | # A proxy which controls the Actor lifecycle
class Celluloid::Proxy::Actor < Celluloid::Proxy::Abstract
attr_reader :thread, :mailbox
def initialize(mailbox, thread)
@mailbox = mailbox
@thread = thread
end
def inspect
# TODO: use a system event to fetch actor state: tasks?
"#<Celluloid::Proxy:... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/proxy/abstract.rb | lib/celluloid/proxy/abstract.rb | module Celluloid::Proxy
# Looks up the actual class of instance, even if instance is a proxy.
def self.class_of(instance)
(class << instance; self; end).superclass
end
end
# Base class of Celluloid proxies
class Celluloid::Proxy::Abstract < BasicObject
# Needed for storing proxies in data structures
need... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/proxy/async.rb | lib/celluloid/proxy/async.rb | # A proxy which sends asynchronous calls to an actor
class Celluloid::Proxy::Async < Celluloid::Proxy::AbstractCall
def method_missing(meth, *args, &block)
if @mailbox == ::Thread.current[:celluloid_mailbox]
args.unshift meth
meth = :__send__
end
if block_given?
# FIXME: nicer exception
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/proxy/block.rb | lib/celluloid/proxy/block.rb | class Celluloid::Proxy::Block
attr_writer :execution
attr_reader :call, :block
def initialize(mailbox, call, block)
@mailbox = mailbox
@call = call
@block = block
@execution = :sender
end
def to_proc
if @execution == :sender
lambda do |*values|
if task = Thread.current[:cel... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/call/sync.rb | lib/celluloid/call/sync.rb | module Celluloid
class Call
# Synchronous calls wait for a response
class Sync < Call
attr_reader :sender, :task, :chain_id
def initialize(
sender,
method,
arguments = [],
block = nil,
task = Thread.current[:celluloid_task],
chain_id = I... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/call/async.rb | lib/celluloid/call/async.rb | module Celluloid
class Call
# Asynchronous calls don't wait for a response
class Async < Call
def dispatch(obj)
Internals::CallChain.current_id = Celluloid.uuid
super(obj)
rescue AbortError => ex
# Swallow aborted async calls, as they indicate the sender made a mistake
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/call/block.rb | lib/celluloid/call/block.rb | module Celluloid
class Call
class Block
def initialize(block_proxy, sender, arguments, task = Thread.current[:celluloid_task])
@block_proxy = block_proxy
@sender = sender
@arguments = arguments
@task = task
end
attr_reader :task
def call
@block_prox... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/logging/ring_buffer.rb | lib/celluloid/logging/ring_buffer.rb | module Celluloid
class RingBuffer
def initialize(size)
@size = size
@start = 0
@count = 0
@buffer = Array.new(size)
@mutex = Mutex.new
end
def full?
@count == @size
end
def empty?
@count == 0
end
def push(value)
@mutex.synchronize do
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/logging/incident_logger.rb | lib/celluloid/logging/incident_logger.rb | require "logger"
module Celluloid
# A logger that holds all messages in circular buffers, then flushes the buffers
# when an event occurs at a configurable severity threshold.
#
# Unlike ruby's Logger, this class only supports a single progname.
class IncidentLogger
module Severity
include ::Logger... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/logging/incident_reporter.rb | lib/celluloid/logging/incident_reporter.rb | require "logger"
module Celluloid
# Subscribes to log incident topics to report on them.
class IncidentReporter
include Celluloid
include Celluloid::Notifications
# get the time from the event
class Formatter < ::Logger::Formatter
def call(severity, _time, progname, msg)
super(severi... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/logging/log_event.rb | lib/celluloid/logging/log_event.rb | module Celluloid
# Wraps a single log event.
class LogEvent
attr_accessor :id, :severity, :message, :progname, :time
def initialize(severity, message, progname, time = Time.now, &_block)
# This id should be ordered. For now relies on Celluloid::UUID to be ordered.
# May want to use a generation... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/logging/incident.rb | lib/celluloid/logging/incident.rb | module Celluloid
# Wraps all events and context for a single incident.
class Incident
attr_accessor :pid
attr_accessor :events, :triggering_event
def initialize(events, triggering_event = nil)
@events = events
@triggering_event = triggering_event
@pid = $PROCESS_ID
end
# Merg... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/version.rb | lib/celluloid/supervision/version.rb | module Celluloid
module Supervision
VERSION = "0.20.6".freeze
end
end
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/constants.rb | lib/celluloid/supervision/constants.rb | module Celluloid
module Supervision
# TODO: Do not hard-code. Allow configurable values.
INSTANCE_RETRY_WAIT = 3
INSTANCE_RETRY_LIMIT = 5
module Error
class NoPublicService < Celluloid::Error; end
end
class Configuration
module Error
class AlreadyDefined < Celluloid::Erro... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/configuration.rb | lib/celluloid/supervision/configuration.rb | module Celluloid
module Supervision
class Configuration
class << self
def deploy(options = {})
define(options).deploy
end
def define(options = {})
new(options)
end
end
extend Forwardable
def_delegators :current_instance,
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/service.rb | lib/celluloid/supervision/service.rb | module Celluloid
module Supervision
module Service
class Root < Container
class << self
def define
super({
supervise: Celluloid.actor_system.root_configuration,
as: :root_supervisor,
accessors: [:root],
branch: :root,
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/supervise.rb | lib/celluloid/supervision/supervise.rb | # collect together all instances of the `supervise` method
module Celluloid
class << self
def supervise(config = {}, &block)
supervisor = Supervision.router(config)
supervisor.supervise(config, &block)
end
end
module ClassMethods
def supervise(config = {}, &block)
Celluloid.supervise... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/validation.rb | lib/celluloid/supervision/validation.rb | module Celluloid
module Supervision
class Configuration
class << self
def valid?(configuration, fails = false)
parameters(:mandatory).each do |k|
unless configuration.key? k
if fails
raise Error::Incomplete, "Missing `:#{k}` in supervision configur... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/container.rb | lib/celluloid/supervision/container.rb | module Celluloid
# Supervise actor instances in a container.
module Supervision
class Container
include Celluloid
trap_exit :restart_actor
class << self
def define(options)
Configuration.define(top(options))
end
def deploy(options)
Configuration.d... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/container/pool.rb | lib/celluloid/supervision/container/pool.rb | module Celluloid
module Supervision
class Container
# Manages a fixed-size pool of actors
# Delegates work (i.e. methods) and supervises actors
# Don't use this class directly. Instead use MyKlass.pool
class Pool
include Celluloid
trap_exit :__crash_handler__
final... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/container/injections.rb | lib/celluloid/supervision/container/injections.rb | module Celluloid
module Supervision
class Container
class Injection
end
end
end
end
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/container/instance.rb | lib/celluloid/supervision/container/instance.rb | module Celluloid
# Supervise collections of actors as a group
module Supervision
class Container
class Instance
attr_reader :name, :actor
# @option options [#call, Object] :args ([]) arguments array for the
# actor's constructor (lazy evaluation if it responds to #call)
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/container/behavior.rb | lib/celluloid/supervision/container/behavior.rb | module Celluloid
module Supervision
class Container
module Behavior
@@injections = {} # Hash of Class => Hash of Injections
@@behaviors = {} # Hash of identifying symbol parameter => Class
module Error
class Mutant < Celluloid::Error; end
end
class << s... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/container/behavior/tree.rb | lib/celluloid/supervision/container/behavior/tree.rb | module Celluloid
module Supervision
class Container
class Tree
include Behavior
identifier! :supervises, :supervise
configuration do
if @configuration[:supervise].is_a? Array
@supervisor = @configuration.dup
@branch = @configuration.fetch(:branch, ... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/container/behavior/pool.rb | lib/celluloid/supervision/container/behavior/pool.rb | require "set"
module Celluloid
module ClassMethods
extend Forwardable
def_delegators :"Celluloid::Supervision::Container::Pool", :pooling_options
# Create a new pool of workers. Accepts the following options:
#
# * size: how many workers to create. Default is worker per CPU core
# * args: arr... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/configuration/injections.rb | lib/celluloid/supervision/configuration/injections.rb | module Celluloid
module Supervision
class Configuration
class Injection
end
end
end
end
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/supervision/configuration/instance.rb | lib/celluloid/supervision/configuration/instance.rb | module Celluloid
module Supervision
class Configuration
class Instance
attr_accessor :configuration
def initialize(configuration = {})
@state = :initializing # :ready
resync_accessors
@configuration = configuration
define(configuration) if configurati... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/group/pool.rb | lib/celluloid/group/pool.rb | module Celluloid
class Group
class Pool < Group
# You do not want to use this. Truly, you do not. There is no scenario when you will.
# But. If you somehow do.. `Celluloid.group_class = Celluloid::Group::Pool` and weep.
attr_accessor :max_idle
def initialize
super
@mutex ... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/group/spawner.rb | lib/celluloid/group/spawner.rb | module Celluloid
class Group
class Spawner < Group
attr_accessor :finalizer
def initialize
super
end
def get(&block)
assert_active
raise ArgumentError, "No block sent to Spawner.get()" unless block_given?
instantiate block
end
def shutdown
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/call_chain.rb | lib/celluloid/internals/call_chain.rb | module Celluloid
module Internals
class CallChain
def self.current_id=(value)
Thread.current[:celluloid_chain_id] = value
task = Thread.current[:celluloid_task]
task.chain_id = value if task
end
def self.current_id
Thread.current[:celluloid_chain_id]
end
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/thread_handle.rb | lib/celluloid/internals/thread_handle.rb | module Celluloid
module Internals
# An abstraction around threads from the InternalPool which ensures we don't
# accidentally do things to threads which have been returned to the pool,
# such as, say, killing them
class ThreadHandle
def initialize(actor_system, role = nil)
@mutex = Mutex... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/logger.rb | lib/celluloid/internals/logger.rb | module Celluloid
module Internals
module Logger
class WithBacktrace
def initialize(backtrace)
@backtrace = backtrace
end
def debug(string)
Celluloid.logger.debug(decorate(string))
end
def info(string)
Celluloid.logger.info(decorate(stri... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/method.rb | lib/celluloid/internals/method.rb | module Celluloid
module Internals
# Method handles that route through an actor proxy
class Method
def initialize(proxy, name)
raise NoMethodError, "undefined method `#{name}'" unless proxy.respond_to? name
@proxy = proxy
@name = name
@klass = @proxy.class
end
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/responses.rb | lib/celluloid/internals/responses.rb | module Celluloid
module Internals
# Responses to calls
class Response
attr_reader :call, :value
def initialize(call, value)
@call = call
@value = value
end
def dispatch
@call.task.resume self
end
# Call completed successfully
class Success <... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/registry.rb | lib/celluloid/internals/registry.rb | module Celluloid
module Internals
# The Registry allows us to refer to specific actors by human-meaningful names
class Registry
def initialize
@root = nil # keep root out of the standard list of registered names
@actors = {} # hash of name => actor
@index = {} # hash o... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/cpu_counter.rb | lib/celluloid/internals/cpu_counter.rb | module Celluloid
module Internals
module CPUCounter
class << self
def cores
@cores ||= count_cores
end
def count_cores
from_result(from_env || from_sysdev || from_java || from_proc || from_win32ole || from_sysctl) || 1
end
def from_env
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/stack.rb | lib/celluloid/internals/stack.rb | module Celluloid
module Internals
class Stack
attr_accessor :actors, :threads
def initialize(threads)
@group = threads
@actors = []
@threads = []
end
def snapshot(backtrace = nil)
@group.each do |thread|
if thread.role == :actor
@act... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/uuid.rb | lib/celluloid/internals/uuid.rb | require "securerandom"
module Celluloid
module Internals
# Clearly Ruby doesn't have enough UUID libraries
# This one aims to be fast and simple with good support for multiple threads
# If there's a better UUID library I can use with similar multithreaded
# performance, I certainly wouldn't mind usin... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/task_set.rb | lib/celluloid/internals/task_set.rb | require "set"
require "forwardable"
module Celluloid
module Internals
if RUBY_PLATFORM == "java"
require "jruby/synchronized"
class TaskSet
extend Forwardable
include JRuby::Synchronized
def_delegators :@tasks, :<<, :delete, :first, :empty?, :to_a
def initialize
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/signals.rb | lib/celluloid/internals/signals.rb | module Celluloid
module Internals
# Event signaling between methods of the same object
class Signals
def initialize
@conditions = {}
end
# Wait for the given signal and return the associated value
def wait(name)
raise "cannot wait for signals while exclusive" if Cellul... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/properties.rb | lib/celluloid/internals/properties.rb | module Celluloid
module Internals
# Properties define inheritable attributes of classes, somewhat similar to
# Rails cattr_*/mattr_* or class_attribute
module Properties
def property(name, opts = {})
default = opts.fetch(:default, nil)
multi = opts.fetch(:multi, false)
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/handlers.rb | lib/celluloid/internals/handlers.rb | require "set"
module Celluloid
module Internals
class Handlers
def initialize
@handlers = Set.new
end
def handle(*patterns, &block)
patterns.each do |pattern|
handler = Handler.new pattern, block
@handlers << handler
end
end
# Handle inc... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/receivers.rb | lib/celluloid/internals/receivers.rb | require "set"
require "timers"
module Celluloid
module Internals
# Allow methods to directly interact with the actor protocol
class Receivers
def initialize(timers)
@receivers = Set.new
@timers = timers
end
# Receive an asynchronous message
def receive(timeout = nil, ... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/links.rb | lib/celluloid/internals/links.rb | module Celluloid
module Internals
# Linked actors send each other system events
class Links
include Enumerable
def initialize
@links = {}
end
# Add an actor to the current links
def <<(actor)
@links[actor.mailbox.address] = actor
end
# Do links incl... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/stack/dump.rb | lib/celluloid/internals/stack/dump.rb | module Celluloid
module Internals
class Stack
class Dump < Stack
def initialize(threads)
super(threads)
snapshot(true)
end
end
end
end
end
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/stack/summary.rb | lib/celluloid/internals/stack/summary.rb | module Celluloid
module Internals
class Stack
class Summary < Stack
def initialize(threads)
super(threads)
snapshot
end
end
end
end
end
| ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/internals/stack/states.rb | lib/celluloid/internals/stack/states.rb | module Celluloid
module Internals
class Stack
module DisplayBacktrace
def display_backtrace(backtrace, output, indent = nil)
backtrace ||= ["EMPTY BACKTRACE"]
backtrace.each do |line|
output << indent if indent
output << "\t" << line << "\n"
end
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/mailbox/evented.rb | lib/celluloid/mailbox/evented.rb | module Celluloid
class Mailbox
# An alternative implementation of Celluloid::Mailbox using Reactor
class Evented < Celluloid::Mailbox
attr_reader :reactor
def initialize(reactor_class)
super()
# @condition won't be used in the class.
@reactor = reactor_class.new
end
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/task/threaded.rb | lib/celluloid/task/threaded.rb | module Celluloid
class Task
# Tasks with a Thread backend
class Threaded < Task
# Run the given block within a task
def initialize(type, meta)
@resume_queue = Queue.new
@exception_queue = Queue.new
@yield_mutex = Mutex.new
@yield_cond = ConditionVariable.new
... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/task/fibered.rb | lib/celluloid/task/fibered.rb | module Celluloid
class Task
# Tasks with a Fiber backend
class Fibered < Task
class StackError < Celluloid::Error; end
def create
queue = Thread.current[:celluloid_queue]
actor_system = Thread.current[:celluloid_actor_system]
@fiber = Fiber.new do
# FIXME: cannot ... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
celluloid/celluloid | https://github.com/celluloid/celluloid/blob/0a307cff21e1a55ddbc5687bcd6ba9e47f89796d/lib/celluloid/actor/system.rb | lib/celluloid/actor/system.rb | module Celluloid
extend Forwardable
def_delegators :actor_system, :[], :[]=
class Actor
class System
extend Forwardable
def_delegators :@registry, :[], :get, :[]=, :set, :delete
ROOT_SERVICES = [
{
as: :notifications_fanout,
type: Celluloid::Notifications::Fanou... | ruby | MIT | 0a307cff21e1a55ddbc5687bcd6ba9e47f89796d | 2026-01-04T15:48:19.397883Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma_spec.rb | spec/fusuma_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma"
require "./lib/fusuma/plugin/inputs/libinput_command_input"
require "./lib/fusuma/plugin/filters/libinput_device_filter"
module Fusuma
RSpec.describe Runner do
describe ".run" do
before do
Singleton.__init__(MultiLogger)
... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require "bundler/setup"
require "rspec/debug"
require "helpers/config_helper"
require "simplecov"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods glob... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/helpers/config_helper.rb | spec/helpers/config_helper.rb | # frozen_string_literal: true
require "tempfile"
require "./lib/fusuma/config"
module Fusuma
module ConfigHelper
module_function
#: (String) -> void
def load_config_yml=(string)
Config.custom_path = Tempfile.open do |temp_file|
temp_file.tap { |f| f.write(string) }
end
end
... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/libinput_command_spec.rb | spec/fusuma/libinput_command_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma/libinput_command"
module Fusuma
RSpec.describe LibinputCommand do
let(:libinput_command) do
described_class.new(libinput_options: libinput_options, commands: commands)
end
let(:libinput_options) { [] }
let(:commands) { {... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/device_spec.rb | spec/fusuma/device_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma/device"
require "./lib/fusuma/plugin/inputs/libinput_command_input"
module Fusuma
RSpec.describe Device do
describe ".all" do
it "should fetch all devices"
end
describe ".reset" do
it "should clear all cache"
end
... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/custom_process_spec.rb | spec/fusuma/custom_process_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma/custom_process"
module Fusuma
RSpec.describe CustomProcess do
before do
test_klass = Class.new do
include CustomProcess
def call
fork { puts "hoge" }
end
def set_trap_dummy
end
... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/multi_logger_spec.rb | spec/fusuma/multi_logger_spec.rb | require "spec_helper"
require "tempfile"
module Fusuma
RSpec.describe MultiLogger do
let(:message) { "test message" }
let(:debug_message) { "debug test message" }
let(:warn_message) { "warn test message" }
let(:error_message) { "error test message" }
let(:ignored_message) { "timer_input should be... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/config_spec.rb | spec/fusuma/config_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma/config"
# spec for Config
module Fusuma
RSpec.describe Config do
let(:keymap) do
{
"swipe" => {
3 => {
"left" => {"command" => "alt+Left"},
"right" => {"command" => "alt+Right"}
},... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/plugin/base_spec.rb | spec/fusuma/plugin/base_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma/plugin/base"
require "./lib/fusuma/plugin/manager"
module Fusuma
module Plugin
class DummyPlugin < Base
def config_param_types
{
dummy_string: String,
dummy_list: Array,
dummy_bool: [TrueClass, ... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/plugin/manager_spec.rb | spec/fusuma/plugin/manager_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma/plugin/base"
require "./lib/fusuma/plugin/manager"
require "./lib/fusuma/plugin/inputs/input"
module Fusuma
module Plugin
RSpec.describe Manager do
let(:manager) { Manager.new(Base) }
describe "#require_siblings_from_plugin_di... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/plugin/executors/command_executor_spec.rb | spec/fusuma/plugin/executors/command_executor_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma/plugin/executors/command_executor"
require "./lib/fusuma/plugin/events/event"
module Fusuma
module Plugin
module Executors
RSpec.describe CommandExecutor do
before do
index = Config::Index.new([:dummy, 1, :directio... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/plugin/executors/executor_spec.rb | spec/fusuma/plugin/executors/executor_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma/config"
require "./lib/fusuma/plugin/executors/executor"
require "./lib/fusuma/plugin/detectors/detector"
require "./lib/fusuma/plugin/events/event"
module Fusuma
module Plugin
module Executors
RSpec.describe Executor do
be... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/plugin/buffers/buffer_spec.rb | spec/fusuma/plugin/buffers/buffer_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "./lib/fusuma/plugin/events/event"
require_relative "dummy_buffer"
module Fusuma
module Plugin
module Buffers
RSpec.describe DummyBuffer do
before do
@buffer = DummyBuffer.new
end
describe "#type" do
... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/plugin/buffers/dummy_buffer.rb | spec/fusuma/plugin/buffers/dummy_buffer.rb | # frozen_string_literal: true
require "./lib/fusuma/plugin/buffers/buffer"
module Fusuma
module Plugin
module Buffers
class DummyBuffer < Buffer
DEFAULT_SOURCE = "dummy"
#: () -> Hash[Symbol, Array[Class] | Class]
def config_param_types
{
source: String,
... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
iberianpig/fusuma | https://github.com/iberianpig/fusuma/blob/789804bc5ab68a1eff20699e0cc138b7e2014a62/spec/fusuma/plugin/buffers/gesture_buffer_spec.rb | spec/fusuma/plugin/buffers/gesture_buffer_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "rspec-parameterized"
require "./lib/fusuma/plugin/events/event"
require "./lib/fusuma/plugin/events/records/gesture_record"
require "./lib/fusuma/plugin/buffers/gesture_buffer"
module Fusuma
module Plugin
module Buffers
RSpec.describe GestureBu... | ruby | MIT | 789804bc5ab68a1eff20699e0cc138b7e2014a62 | 2026-01-04T15:48:35.485710Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.