class

Nucleoc::Nucleo(T)

Inherits Reference < Object

A high-level matcher worker that computes matches in background fibers.

Constructors

new(config : Config = Config.new, notify : -> Nil = -> do nil end, num_threads : Int32 | Nil = nil, columns : Int32 = 1)

Constructs a new nucleo worker.

  • config - The matcher configuration
  • notify - Called when new information is available and tick should be called
  • num_threads - Number of worker threads (not used in Crystal fiber version)
  • columns - Number of columns for multi-column matching
Source

Instance methods

active_injectors

Returns the number of active injectors.

Source
injector

Returns an injector for adding items to this matcher.

Source
pattern

The pattern matched by this matcher.

Source
reparse(column : Int32, new_text : String, case_matching : CaseMatching = CaseMatching::Smart, normalization : Normalization = Normalization::Smart, append : Bool = false) : Nil

Updates the pattern for a column.

Source
restart(clear_snapshot : Bool = false) : Nil

Restarts the matcher, optionally clearing the current snapshot.

Source
reverse_items(reverse_items : Bool) : Nil

Reverses the sort order of match results.

Source
snapshot

Returns a read-only snapshot of the current match state.

Source
sort_results(sort_results : Bool) : Nil

Enables or disables sorting of match results by score.

Source
tick(timeout : UInt64 = 0) : Status

Processes pending updates and returns the current status.

  • timeout - Maximum time to wait for updates (in milliseconds)
Source
update_config(config : Config) : Nil

Updates the matcher configuration.

Source