[dreamwidth/dreamwidth] 388d47: Add JSON wire format for task queue with gradual r...
Branch: refs/heads/main Home: https://github.com/dreamwidth/dreamwidth Commit: 388d47d72bfa348ef6378e9f5e638e9fa85da491 https://github.com/dreamwidth/dreamwidth/commit/388d47d72bfa348ef6378e9f5e638e9fa85da491 Author: Mark Smith mark@dreamwidth.org Date: 2026-04-11 (Sat, 11 Apr 2026)
Changed paths: M cgi-bin/DW/Task.pm M cgi-bin/DW/TaskQueue/LocalDisk.pm M cgi-bin/DW/TaskQueue/SQS.pm M etc/config-local.pl.example A t/taskqueue-serialize.t A t/taskqueue.t
Log Message:
Add JSON wire format for task queue with gradual rollout support
Adds serialize/deserialize methods to DW::Task that support a new v2 JSON wire format alongside the legacy Storable format. This enables non-Perl consumers (e.g. Go workers) to read task queue messages.
$LJ::TASK_QUEUE_JSON controls the rollout as a float 0-1 (e.g. 0.01 = 1% of messages serialized as JSON). Default is 0 (all Storable). All consumers can read both formats regardless of this setting. If JSON encoding fails for a task (e.g. blessed objects in args), it falls back to Storable with a warning and stat tag identifying the task class.
Also adds task queue config documentation to config-local.pl.example and comprehensive test coverage for LocalDisk lifecycle, serialization round-trips, and queue_attributes.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
To unsubscribe from these emails, change your notification settings at https://github.com/dreamwidth/dreamwidth/settings/notifications
