Sha256: d86f8a4459f3152702b29601d4887e8bf5ab9e7d810b41829d9a040d00fc1dae
Contents?: true
Size: 562 Bytes
Versions: 1
Compression:
Stored size: 562 Bytes
Contents
# frozen_string_literal: true require "trellodon/schedulers/base" require "concurrent" module Trellodon module Schedulers class Concurrent < Base using RubyNext DEFAULT_MAX_THREADS = 50 attr_reader :max_threads def initialize(threads_count = DEFAULT_MAX_THREADS) @max_threads = threads_count end def post(&block) ::Concurrent::Future.execute(executor: executor, &block) end private def executor ::Concurrent::FixedThreadPool.new(max_threads) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
trellodon-0.2.1 | lib/.rbnext/3.1/trellodon/schedulers/concurrent.rb |