Skip to main content

Crate perl_lsp_cancellation

Crate perl_lsp_cancellation 

Source
Expand description

Enhanced LSP cancellation infrastructure with thread-safe atomic operations

This module provides comprehensive cancellation support for Perl LSP operations, including provider-specific cancellation tokens, cleanup coordination, and performance-optimized atomic operations.

§Architecture

The cancellation system implements a dual-layer design:

  1. Global cancellation registry - Thread-safe coordination of all active requests
  2. Provider-specific tokens - Context-aware cancellation with cleanup callbacks

§Performance Characteristics

  • Cancellation check latency: <100μs using atomic operations
  • End-to-end response time: <50ms from $/cancelRequest to error response
  • Memory overhead: <1MB for complete cancellation infrastructure
  • Thread-safe concurrent operations with zero-copy atomic checks

Macros§

check_cancellation
Macro for adding cancellation checkpoints with minimal performance impact

Structs§

CancellationMetrics
Performance metrics for cancellation system
CancellationRegistry
Thread-safe cancellation registry for concurrent request coordination
PerlLspCancellationToken
Thread-safe cancellation token with atomic operations Optimized for <100μs check latency using atomic operations
ProviderCleanupContext
Provider cleanup context for graceful cancellation handling
RequestCleanupGuard
RAII guard for automatic cancellation cleanup

Enums§

CancellationError
Cancellation errors

Statics§

GLOBAL_CANCELLATION_REGISTRY
Default global cancellation registry instance for thread-safe cancellation coordination

Traits§

CancellableProvider
Trait for cancellable LSP providers