Check for Grid Updates (Worker)
worker_check_updates.RdNon-blocking check for grid state updates from the publisher socket. Updates the worker's local cache if new pixel updates are available.
Arguments
- worker_state
List. Worker state from
worker_init().
Details
Polls the subscriber socket for new messages without blocking. If updates are available, processes all queued messages and updates the local black_pixels cache and version number.
This function should be called periodically between walker steps to keep the cache reasonably fresh. In Phase 1, it's called before each walker step.
Update message format (from broadcaster):
list(type = "pixel_update", position = c(row, col), version = int)