From 7a9054bb3f033c98067b3196378311dae54c5fbf Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 20 Jan 2026 01:31:53 +0000
Subject: [PATCH] =OperationQueue refactor to the JVBase/managers/queue namespace

---
 inc/rest/routes/ContentRoutes.php |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/inc/rest/routes/ContentRoutes.php b/inc/rest/routes/ContentRoutes.php
index 43b1f9f..8ff8c78 100644
--- a/inc/rest/routes/ContentRoutes.php
+++ b/inc/rest/routes/ContentRoutes.php
@@ -3,6 +3,8 @@
 namespace JVBase\rest\routes;
 
 use JVBase\JVB;
+use JVBase\managers\queue\executors\ContentExecutor;
+use JVBase\managers\queue\TypeConfig;
 use JVBase\rest\RestRouteManager;
 use JVBase\managers\CacheManager;
 use JVBase\meta\MetaManager;
@@ -30,9 +32,6 @@
 	protected array $timelineSharedFields = [];
 	protected array $timelineUniqueFields = [];
 
-	//TODO: Ensure we are handling the bulk operations for all processes
-	//TODO: Also invalidate feed caches on updates!!
-
 	public function __construct()
 	{
 		$this->cache_name = 'user_content_' . get_current_user_id();
@@ -40,7 +39,28 @@
 		$this->cache->clear();
 		$this->action = 'dash-';
 		$this->operation_type = 'content_update';
-		add_filter(BASE . 'handle_bulk_operation', [$this, 'processOperation'], 10, 3);
+		add_action('init', [$this, 'registerContentExecutors'], 5);
+	}
+
+	/**
+	 * Register content operation types with the queue's TypeRegistry
+	 */
+	public function registerContentExecutors(): void
+	{
+		$registry = JVB()->queue()->registry();
+		$executor = new ContentExecutor();
+
+		// Content updates - chunked at 10 posts
+		$registry->register('content_update', new TypeConfig(
+			executor: $executor,
+			chunkKey: 'posts',
+			chunkSize: 10
+		));
+
+		// Batch creation (from uploads)
+		$registry->register('batch_creation', new TypeConfig(
+			executor: $executor
+		));
 	}
 
 	/**

--
Gitblit v1.10.0