noCV
SFFI-105 · Control resources and concurrency

Move blocking compression off the JavaScript event loop

Practice briefTaskAdvanced

A 50 MB synthetic buffer blocks timers and health checks because the binding invokes native compression synchronously.

Focused work estimate
4h + prerequisites
Priority in the scenario
High
Engineering practice
Async runtimes · Performance · Backpressure

Estimated field mix

  • Systems programming60%
  • Performance engineering40%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional desktop backup tool calls a small Rust compression library from Node.js. The binding leaks buffers on exceptions and treats ABI mismatches as corrupted input. Build against generated byte arrays and a local native library; no production archive format or user files are supplied.

Setup prerequisites

  • FFI ownership
  • Binary compatibility
  • Error handling

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Large work runs in a bounded worker pool
  • Completion returns on the expected runtime thread
  • Queue saturation rejects before copying the full input

Implementation constraints

  • Measure copy cost separately from compression time and cap fixture size.

Verification to include

  • Compress concurrent small and large buffers while measuring timer delay.
  • Saturate the pool and confirm bounded memory with a typed overload result.

Deliverables

  • Asynchronous binding and event-loop latency report

Rollout and recovery

Route buffers above a measured threshold first and retain synchronous fallback for small fixtures.

Value of the work

For the engineer: Practice language-boundary contracts, native resource safety and version negotiation.

For the team: Review a binding that fails safely and can be rolled back before native code enters additional application paths.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.