Skip to content

Instantly share code, notes, and snippets.

Avatar
:electron:
Working as always

Yaroslav Barkovskiy DCrow

:electron:
Working as always
View GitHub Profile
@DCrow
DCrow / dump_backtrace.rb
Last active Jul 11, 2018
Sidekiq cli threads
View dump_backtrace.rb
# Sidekiq process structure
# 1 main thread https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/cli.rb#L104
# 1 heartbeat thread https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/launcher.rb#L23
# 1 scheduled thread https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/scheduled.rb#L63
# options[:concurency] manager threads https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/manager.rb#L44
# If using sidekiq-scheduler gem
# 1 rufus scheduler thread https://github.com/jmettraux/rufus-scheduler/blob/master/lib/rufus/scheduler.rb#L537
# Some arbitrary number up to :max_work_threads https://github.com/jmettraux/rufus-scheduler/blob/master/lib/rufus/scheduler/jobs.rb#L332
@DCrow
DCrow / device_driver.cpp
Last active Mar 29, 2017
How to wrap a C struct in a ruby extension
View device_driver.cpp
#include "ruby.h"
// http://www.angelfire.com/electronic2/issac/rb_cpp_ext_tut.txt
typedef VALUE (ruby_method)(...);
VALUE DeviceDriver = Qnil;
struct conn {
VALUE settings;
connection *conn_ptr;
};
You can’t perform that action at this time.