'use strict';

const { parentPort } = require('node:worker_threads');

parentPort.on('message', (msg) => {
  if (msg?.type === 'close') {
    parentPort.postMessage({ type: 'closed' });
    return;
  }
  parentPort.postMessage({
    type: 'error',
    op: msg?.type || 'unknown',
    requestId: msg?.requestId,
    error: 'scrollback DB writes are owned by the CTM DB owner worker',
  });
});
