Skip to content

docs: update Rust SDK docs for posthog-rs v0.14 (fire-and-forget capture)#17921

Merged
cat-ph merged 1 commit into
masterfrom
ci/rust-v0.14-docs
Jun 25, 2026
Merged

docs: update Rust SDK docs for posthog-rs v0.14 (fire-and-forget capture)#17921
cat-ph merged 1 commit into
masterfrom
ci/rust-v0.14-docs

Conversation

@cat-ph

@cat-ph cat-ph commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Problem

posthog-rs v0.14 (the runtime-independent background transport, posthog-rs#145) made capture and capture_batch non-blocking and infallible — they dropped async and Result and now enqueue onto a background worker. The Rust docs still showed the old API (client.capture(event).await.unwrap()), pinned 0.13.1, described blocking-mode capture as a synchronous network call, and never mentioned flush() / shutdown(). So the examples no longer compile and the guidance is wrong.

Changes

  • Drop .await.unwrap() from every capture / capture_batch example (they now return ()). capture_exception is left as-is — it's still async and fallible.
  • Bump the install version pin 0.13.10.14.
  • Rewrite the install snippet's blocking-mode note: capture is non-blocking in both modes (a background worker batches and sends), not a synchronous API call.
  • Add a Flushing events section to the send-events snippet documenting flush() / shutdown() and the need to flush before process exit so buffered events aren't lost.

Touched: install-rust, send-events-rust, feature-flags-code-rust, experiments/installation/rust, product-analytics/identify, the two product-analytics capture snippets, and getting-started/user-properties-how-to-set.

Testing

  • Verified every example against the shipped v0.14 API: capture / capture_batch are pub fn … -> (); flush / shutdown are async on the async client and sync on the blocking client.
  • Grepped the whole contents/docs tree to confirm no stale capture(...).await / .unwrap() remain and that capture_exception is untouched.

Opened as a draft.

…ure)

v0.14 (the runtime-independent background transport) made `capture` and
`capture_batch` non-blocking and infallible — no `async`, no `Result`; they
enqueue onto a background worker. Update the docs to match:

- Drop `.await.unwrap()` from every `capture` / `capture_batch` example (they
  now return `()`). `capture_exception` keeps `.await.unwrap()` — still fallible.
- Bump the install version pin 0.13.1 -> 0.14.
- Rewrite the install-snippet's blocking-mode note: `capture` is non-blocking in
  both modes (background worker), not a synchronous network call.
- Add a "Flushing events" section to the send-events snippet documenting
  `flush()` / `shutdown()` and the need to flush before process exit so buffered
  events aren't lost.
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Deploy preview

Status Details Updated (UTC)
🟢 Ready View preview Jun 24, 2026 10:39PM

@github-actions

Copy link
Copy Markdown
Contributor

Vale prose linter → found 0 errors, 5 warnings, 3 suggestions in your markdown

Full report → Copy the linter results into an LLM to batch-fix issues.

Linter being weird? Update the rules!

contents/docs/experiments/installation/rust.mdx — 0 errors, 1 warnings, 1 suggestions
Line Severity Message Rule
2:13 warning Capitalize 'Experiments' for PostHog's product. Use 'experiments' for the general industry concept. PostHogBase.ProductNames
78:79 suggestion Address the reader directly. Use 'you' instead of 'the user'. PostHogDocs.DirectAddress
contents/docs/integrate/feature-flags-code/_snippets/feature-flags-code-rust.mdx — 0 errors, 4 warnings, 2 suggestions
Line Severity Message Rule
1:34 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
5:41 suggestion Address the reader directly. Use 'you' instead of 'the user'. PostHogDocs.DirectAddress
7:14 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
24:19 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
107:57 suggestion Address the reader directly. Use 'you' instead of 'the user'. PostHogDocs.DirectAddress
125:9 warning 'deduplicates' is a possible misspelling. PostHogBase.Spelling

@cat-ph cat-ph marked this pull request as ready for review June 24, 2026 22:31
@cat-ph cat-ph requested review from a team, ablaszkiewicz, hpouillot and marandaneto June 24, 2026 22:31
@github-actions

Copy link
Copy Markdown
Contributor

Bundle report

Total JS (gzip)

6.22 MiB (+0.3 KiB / +0.0%)

Eager graph (static-import closure per entrypoint)

Entrypoint Eager size Budget Modules
app 24.14 MiB (+1.1 KiB / +0.0%) report-only 5510
Largest modules in the app closure
Module Size
css ./node_modules/.pnpm/css-loader@5.2.7_webpack@5.101.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.5.6_webpack@5.101.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css 710.3 KiB
./src/components/Stickers/Stickers.tsx 696.4 KiB
./.cache/caches/gatsby-plugin-mdx/mdx-scopes-dir/31a094f140f119e73085d847ae81b99b.js + 2 modules 533.6 KiB
./node_modules/.pnpm/@radix-ui+react-icons@1.3.2_react@18.3.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js 481.4 KiB
./node_modules/.pnpm/@codemirror+view@6.38.2/node_modules/@codemirror/view/dist/index.js 458.1 KiB
./node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js + 29 modules 395.1 KiB
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.cjs.js 364.8 KiB
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js 354.8 KiB
./src/hooks/useCustomers.tsx + 54 modules 353.9 KiB
./node_modules/.pnpm/react-markdown@8.0.7_@types+react@16.14.66_react@18.3.1/node_modules/react-markdown/lib/react-markdown.js + 88 modules 351.4 KiB
./node_modules/.pnpm/cloudinary-core@2.14.0_lodash@4.17.21/node_modules/cloudinary-core/cloudinary-core.js 281.9 KiB
./node_modules/.pnpm/@codesandbox+sandpack-react@2.20.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@codesandbox/sandpack-react/dist/index.mjs 266.6 KiB
./src/components/ProductComparisonTable/index.tsx + 114 modules 264.0 KiB
./node_modules/.pnpm/d3@7.9.0/node_modules/d3/src/index.js + 208 modules 247.4 KiB
./src/components/Pricing/PricingSlider/Slider.tsx + 87 modules 239.9 KiB

Eager-graph budgets are report-only until a baseline is established. Sizes are gzip of public/**/*.js; eager size is webpack module source bytes.

@cat-ph cat-ph merged commit cb21c51 into master Jun 25, 2026
20 checks passed
@cat-ph cat-ph deleted the ci/rust-v0.14-docs branch June 25, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants