Files
jellytau/api/jellytau_lib/commands/sync_drain/index.html
T

16 lines
9.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Draining the offline mutation queue (`sync_queue`) to the server."><title>jellytau_lib::commands::sync_drain - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="jellytau_lib" data-themes="" data-resource-suffix="" data-rustdoc-version="1.97.1 (8bab26f4f 2026-07-14)" data-channel="1.97.1" data-search-js="search-fd9372ac.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-fcd733ba.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module sync_drain</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../jellytau_lib/index.html">jellytau_<wbr>lib</a><span class="version">0.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module sync_<wbr>drain</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In jellytau_<wbr>lib::<wbr>commands</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">jellytau_lib</a>::<wbr><a href="../index.html">commands</a></div><h1>Module <span>sync_<wbr>drain</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/jellytau_lib/commands/sync_drain.rs.html#1-1094">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Draining the offline mutation queue (<code>sync_queue</code>) to the server.</p>
<p><code>sync_queue</code> had producers but no consumer: <code>PlaybackReporter::queue_for_sync</code>
inserts a row whenever a start/stop/mark-played cannot reach the server, and
nothing ever pushed one. <code>sync_mark_processing</code>/<code>_completed</code>/<code>_failed</code> were
registered commands with no callers, so the queue only grew — the offline
banners “N pending” climbed forever and the watch positions those rows stood
for never reached Jellyfin.</p>
<p>Same shape as the favourites drain (DR-120), and for the same reason: a drain
started by a component dies with it, so it lives in Rust and hangs off the
<code>connectivity:reconnected</code> transition the <code>ConnectivityMonitor</code> already emits.</p>
<p>TRACES: UR-025, UR-002 | DR-131 | UT-122</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.DrainReport.html" title="struct jellytau_lib::commands::sync_drain::DrainReport">Drain<wbr>Report</a></dt><dd>What a drain did, for logging and for the frontends “Sync now” button.</dd><dt><a class="struct" href="struct.PushFailure.html" title="struct jellytau_lib::commands::sync_drain::PushFailure">Push<wbr>Failure</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Why a push failed, and whether the row should be charged an attempt for it.</dd><dt><a class="struct" href="struct.QueuedRow.html" title="struct jellytau_lib::commands::sync_drain::QueuedRow">Queued<wbr>Row</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.QueuedOp.html" title="enum jellytau_lib::commands::sync_drain::QueuedOp">Queued<wbr>Op</a></dt><dd>A queued mutation, resolved from its stored <code>operation</code> + JSON <code>payload</code>.</dd></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.MAX_SYNC_ATTEMPTS.html" title="constant jellytau_lib::commands::sync_drain::MAX_SYNC_ATTEMPTS">MAX_<wbr>SYNC_<wbr>ATTEMPTS</a></dt><dd>How many times a row may fail before it stops being retried.</dd><dt><a class="constant" href="constant.SYNC_QUEUE_CHANGED_EVENT.html" title="constant jellytau_lib::commands::sync_drain::SYNC_QUEUE_CHANGED_EVENT">SYNC_<wbr>QUEUE_<wbr>CHANGED_<wbr>EVENT</a></dt><dd>Emitted after a drain so open views can re-read the queue instead of waiting
for the frontends 10s poll.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.SyncSink.html" title="trait jellytau_lib::commands::sync_drain::SyncSink">Sync<wbr>Sink</a></dt><dd>The slice of the repository the drain needs — narrow so it can be doubled in
a test without forty <code>unimplemented!()</code> methods.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.drain_sync_queue.html" title="fn jellytau_lib::commands::sync_drain::drain_sync_queue">drain_<wbr>sync_<wbr>queue</a></dt><dd>Push every queued mutation for this user, oldest first.</dd><dt><a class="fn" href="fn.enqueue_playback_stopped.html" title="fn jellytau_lib::commands::sync_drain::enqueue_playback_stopped">enqueue_<wbr>playback_<wbr>stopped</a></dt><dd>Queue a watch position that could not be reported to the server.</dd><dt><a class="fn" href="fn.mark_completed.html" title="fn jellytau_lib::commands::sync_drain::mark_completed">mark_<wbr>completed</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.mark_deferred.html" title="fn jellytau_lib::commands::sync_drain::mark_deferred">mark_<wbr>deferred</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Put a row back in the queue untouched apart from its error note — used when
the server was simply unreachable.</dd><dt><a class="fn" href="fn.mark_failed.html" title="fn jellytau_lib::commands::sync_drain::mark_failed">mark_<wbr>failed</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.parse_queued_op.html" title="fn jellytau_lib::commands::sync_drain::parse_queued_op">parse_<wbr>queued_<wbr>op</a></dt><dd>Turn a stored row into something pushable.</dd><dt><a class="fn" href="fn.read_queue.html" title="fn jellytau_lib::commands::sync_drain::read_queue">read_<wbr>queue</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.remaining_count.html" title="fn jellytau_lib::commands::sync_drain::remaining_count">remaining_<wbr>count</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.run_drain.html" title="fn jellytau_lib::commands::sync_drain::run_drain">run_<wbr>drain</a></dt><dd>Resolve app state and drain. Shared by the reconnect hook and the manual
“Sync now” command.</dd><dt><a class="fn" href="fn.spawn_sync_queue_drain.html" title="fn jellytau_lib::commands::sync_drain::spawn_sync_queue_drain">spawn_<wbr>sync_<wbr>queue_<wbr>drain</a></dt><dd>Drain on every offline→online transition.</dd><dt><a class="fn" href="fn.sync_process_pending.html" title="fn jellytau_lib::commands::sync_drain::sync_process_pending">sync_<wbr>process_<wbr>pending</a></dt><dd>Push the queue now, on the users say-so, instead of waiting for a reconnect.</dd></dl></section></div></main></body></html>