The grid (background worker) ยท console.info
{op} received a function argument and cannot cross the worker boundary; running on the main thread
Printed by The grid (background worker), prefixed [lattice], since 1.0.1.
Warnings reference › worker/local-*
- Identifier
worker/local-*- Raised by
- The grid (background worker)
- Since
- 1.0.1
What happened
Informational, not a fault. This pass was big enough to be worth offloading and the worker was ready, but one of its arguments is a function - a comparator, a predicate, a value getter - and a function cannot be structured-cloned to a worker. The pass ran on the main thread instead, with the same result and no parallelism. The key carries the operation, so a grid that does this for sort and filter says so once each.
The fix
Nothing is broken. If the main-thread cost matters, express the rule in data rather than in a closure - a declared column type, a filters.where condition, or sort by column id - so the plan is portable and can be offloaded.
Reference
Covered in full at the API reference.