This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
ObjectContext, | |
Rand, | |
service, | |
TerminalError, | |
type Context, | |
} from "@restatedev/restate-sdk"; | |
class CircuitBreakerState { | |
constructor( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
import restate | |
app = FastAPI() | |
@app.get("/") | |
async def foo(): | |
return { "foo" : "bar" } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { service, type Context } from "@restatedev/restate-sdk"; | |
interface ServiceB { | |
greet: (ctx: Context, name: string) => Promise<string>; | |
} | |
const realServiceB = service({ | |
name: "realServiceB", | |
handlers: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Subscriber = { | |
service: string; | |
handler: string; | |
key?: string; | |
}; | |
export const pubsub = restate.object({ | |
name: "pubsub", | |
handlers: { | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as restate from "@restatedev/restate-sdk"; | |
export type WorkItem = { | |
item: number; // compute item factorial | |
}; | |
export type WorkRequest = { | |
awekable: string; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
n1: | |
image: ghcr.io/restatedev/restate:main | |
ports: | |
- 8080:8080 | |
- 9070:9070 | |
- 5123:5123 | |
restart: "no" | |
environment: | |
RESTATE_LOG_FILTER: restate=info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2023-2024 - Restate Software, Inc., Restate GmbH | |
* | |
* This file is part of the Restate SDK for Node.js/TypeScript, | |
* which is released under the MIT license. | |
* | |
* You can find a copy of the license in file LICENSE in the root | |
* directory of this repository or package, or at | |
* https://github.com/restatedev/sdk-typescript/blob/main/LICENSE | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type TodoItem = { | |
title: string, | |
completed: boolean, | |
} | |
export default restate.object({ | |
name : "todo", | |
handlers: { | |
add: async (ctx: ObjectContext, item: TodoItem) => { | |
const items = await ctx.get("items") ?? []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Smoke Python Test | |
================= | |
from datetime import timedelta | |
from statefun import * | |
################################################################################ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
autoconf \ | |
libtool \ | |
pkg-config \ | |
libprotobuf-dev \ | |
protobuf-compiler \ | |
protobuf-compiler-grpc \ |
NewerOlder