Skip to content

Instantly share code, notes, and snippets.

View slinkydeveloper's full-sized avatar

Francesco Guardiani slinkydeveloper

View GitHub Profile
import * as restate from "@restatedev/restate-sdk";
import {RestatePromise, TerminalError} from "@restatedev/restate-sdk";
import {readFile} from "fs/promises";
import {join} from "path";
import type * as dosswf from "./workflow_dsl_types"
import * as dosswfruntime from "./workflow_interpreter_runtime"
type ActionStackElement = { id: number, stepIds: string[] };
type ExecuteRequest = {
steps: dosswf.ActionStep[];

Standalone handler styles

Bare generator

greet: function*(name: string) {
  return `Hello, ${name}!`;
},
import {
service,
Operation, sleep,
internal as restateInternal, date
} from "@restatedev/restate-sdk-gen";
import * as restate from "@restatedev/restate-sdk";
import {Attributes, Context, Counter, Histogram, metrics} from '@opentelemetry/api';
import {
ConsoleMetricExporter,
MeterProvider,
@slinkydeveloper
slinkydeveloper / getJournal.ts
Created June 16, 2026 12:14
Getting journal through SQL
// ---------------------------------------------------------------------------
// Journal data model
// ---------------------------------------------------------------------------
type Bytes = number[];
type CompletionId = number;
type MillisSinceEpoch = number;
interface Header {
name: string;
import dev.restate.integration.Invocation;
import dev.restate.integration.ProducerNotReadyException;
import java.util.concurrent.CompletableFuture;
/**
* An at-least-once producer: the client assigns a monotonically increasing offset to each
* invocation. Deduplication is disabled (empty producer id); add an idempotency key on the
* invocations if you need handler-level dedup.
*