TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/msolli/proletarian/llms.txt
Use this file to discover all available pages before exploring further.
Serializer protocol controls how job payloads travel between your application and the database. Proletarian stores job payloads in a TEXT column; the Serializer is responsible for converting any Clojure value to a string on write (encode) and converting that string back to the original value on read (decode). The default implementation uses Transit JSON via proletarian.transit/create-serializer.
Namespace: proletarian.protocols
Protocol Definition
Methods
Called by
proletarian.job/enqueue! before writing the payload to the database.- Arguments:
_(the serializer instance),data(any Clojure value) - Returns: a
Stringrepresentation ofdata
Called by the worker when reading a job from the database, before passing the payload to
handler-fn.- Arguments:
_(the serializer instance),data-string(aStringas stored in the database) - Returns: the original Clojure value
Default Serializer
The default serializer is the Transit JSON serializer created byproletarian.transit/create-serializer. It handles all standard Clojure data types plus java.time.Instant out of the box. See the Transit serializer reference for details.
Implementing a Custom Serializer
ImplementSerializer using reify and supply the instance via the :proletarian/serializer option in both enqueue! and create-queue-worker.
Example: JSON serializer with jsonista
Registering the custom serializer
Pass the same instance to bothenqueue! and create-queue-worker:
