Sha256: 2d9ac74d228dd3ea6d8b703c29debd8ad0fcc39ab5cdb976c0bf09569830dcbd

Contents?: true

Size: 1.27 KB

Versions: 7

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

require_relative '../accessors'

module FFI
  module Libfuse
    # struct fuse_loop_config {
    #   int clone_fd;
    #   unsigned int max_idle_threads;
    # };
    class FuseLoopConfig < FFI::Struct
      include(FFI::Accessors)

      layout(
        clone_fd: :int,
        max_idle: :int
      )

      # @!attribute [rw] clone_fd
      #   whether to use separate device fds for each thread (may increase performance)
      #   Unused by ffi-libfuse as we do not call fuse_loop_mt
      #   @return [Boolean]
      ffi_attr_reader(:clone_fd) do |v|
        v != 0
      end

      ffi_attr_writer(:clone_fd) do |v|
        v ? 1 : 0
      end

      # @!attribute [rw] max_idle_threads
      #   The maximum number of available worker threads before they start to get deleted when they become idle. If not
      #    specified, the default is 10.
      #
      #   Adjusting this has performance implications; a very small number of threads in the pool will cause a lot of
      #    thread creation and deletion overhead and performance may suffer. When set to 0, a new thread will be created
      #    to service every operation.
      #
      #   @return [Integer] the maximum number of threads to leave idle
      ffi_attr_accessor(:max_idle)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ffi-libfuse-0.4.0 lib/ffi/libfuse/fuse_loop_config.rb
ffi-libfuse-0.3.4 lib/ffi/libfuse/fuse_loop_config.rb
ffi-libfuse-0.3.3 lib/ffi/libfuse/fuse_loop_config.rb
ffi-libfuse-0.1.0.rc20220550 lib/ffi/libfuse/fuse_loop_config.rb
ffi-libfuse-0.0.1.rctest12 lib/ffi/libfuse/fuse_loop_config.rb
ffi-libfuse-0.0.1.rctest11 lib/ffi/libfuse/fuse_loop_config.rb
ffi-libfuse-0.0.1.pre lib/ffi/libfuse/fuse_loop_config.rb