Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Latest commit

 

History

History
267 lines (170 loc) · 12.8 KB

README.md

File metadata and controls

267 lines (170 loc) · 12.8 KB

Orleans Samples

Important

📢 This collection of samples has been moved to the official dotnet/samples repository and is part of the Samples browser experience.

A Hello, World! application which demonstrates how to create and use your first grains.

Demonstrates

  • How to get started with Orleans
  • How to define and implement grain interface
  • How to get a reference to a grain and call a grain

Before there were graphical user interfaces, before the era of game consoles and massive-multiplayer games, there were VT100 terminals and there was Colossal Cave Adventure, Zork, and Microsoft Adventure. Possibly lame by today's standards, back then it was a magical world of monsters, chirping birds, and things you could pick up. It's the inspiration for this sample.

Demonstrates

  • How to structure an application (in this case, a game) using grains
  • How to connect an external client to an Orleans cluster (ClientBuilder)

A social network pub/sub system, with short text messages being sent between users. Publishers send out short "Chirp" messages (not to be confused with "Tweets", for a variety of legal reasons) to any other users that are following them.

Demonstrates

  • How to build a simplified social media / social network application using Orleans
  • How to store state within a grain using grain persistence (IPersistentState<T>)
  • Grains which implement multiple grain interfaces
  • Reentrant grains, which allow for multiple grain calls to be executed concurrently, in a single-threaded, interleaving fashion
  • Using a grain observer (IGrainObserver) to receive push notifications from grains

A service for tracking GPS-equipped IoT devices on a map. Device locations are updated in near-real-time using SignalR and hence this sample demonstrates one approach to integrating Orleans with SignalR. The device updates originate from a device gateway, which is implemented using a separate process which connects to the main service and simulates a number of devices moving in a pseudorandom fashion around an area of San Francisco.

Demonstrates

  • How to use Orleans to build an Internet of Things application
  • How Orleans can be co-hosted and integrated with ASP.NET Core SignalR
  • How to broadcast real-time updates from a grain to a set of clients using Orleans and SignalR

An English-Mandarin dictionary Web application demonstrating deployment to Kubernetes, fan-out grain calls, and request throttling.

Demonstrates

  • How to build a realistic application using Orleans
  • How to deploy an Orleans-based application to Kubernetes
  • How to integrate Orleans with ASP.NET Core and a Single-page Application JavaScript framework (Vue.js)
  • How to implement leaky-bucket request throttling
  • How to load and query data from a database
  • How to cache results lazily and temporarily
  • How to fan-out requests to many grains and collect the results

A gaming presence service, similar to one of the Orleans-based services built for Halo. A presence service tracks players and game sessions in near-real-time.

Demonstrates

  • A simplified version of a real-world use of Orleans
  • Using a grain observer (IGrainObserver) to receive push notifications from grains

A Web-based Tic-tac-toe game using ASP.NET MVC, JavaScript, and Orleans.

Demonstrates

  • How to build an online game using Orleans
  • How to build a basic game lobby system
  • How to access Orleans grains from an ASP.NET Core MVC application

A Web application for voting on a set of choices. This sample demonstrates deployment to Kubernetes. The application uses .NET Generic Host to co-host ASP.NET Core and Orleans as well as the Orleans Dashboard together in the same process.

Demonstrates

  • How to deploy an Orleans-based application to Kubernetes
  • How to configure the Orleans Dashboard

A terminal-based chat application built using Orleans Streams.

Demonstrates

Simulates bank accounts, using ACID transactions to transfer random amounts between a set of accounts.

Demonstrates

  • How to use Orleans Transactions to safely perform operations involving multiple stateful grains with ACID guarantees and serializable isolation.

These two Blazor samples are based on the Blazor introductory tutorials, adapted for use with Orleans. The Blazor WebAssembly sample uses the Blazor WebAssembly hosting model. The Blazor Server sample uses the Blazor Server hosting model. They include an interactive counter, a TODO list, and a Weather service.

Demonstrates

  • How to integrate ASP.NET Core Blazor Server with Orleans
  • How to integrate ASP.NET Core Blazor WebAssembly (WASM) with Orleans

A stock price application which fetches prices from a remote service using an HTTP call and caches prices temporarily in a grain. A BackgroundService periodically polls for updates stock prices from various StockGrain grains which correspond to a set of stock symbols.

Demonstrates

  • How to use Orleans from within a BackgroundService.
  • How to use timers within a grain
  • How to make external service calls using .NET's HttpClient and cache the results within a grain.

A Hello, World! application configured to use mutual Transport Layer Security to secure network communication between every server.

Demonstrates

  • How to configure mutual-TLS (mTLS) authentication for Orleans

A compiled list of examples varying in difficulty.

Demonstrates

  • How to develop Orleans-based applications

A Hello, World! application using Visual Basic.

Demonstrates

  • How to develop Orleans-based applications using Visual Basic

A Hello, World! application using F#.

Demonstrates

  • How to develop Orleans-based applications using F#

In-memory clustering example where everything is written in F#:

  • Clustered Silos
  • Concurrent Clients
  • Grains
  • Interfaces

Demonstrates

  • How to develop Orleans-based applications using F# end to end
  • How to use grain reminders in an F# grain

Demonstrates

  • How to develop a reminder grain in F#

An application using Orleans Streams with Azure Event Hubs as the provider and implicit subscribers.

Demonstrates

  • How to use Orleans Streams
  • How to use the [ImplicitStreamSubscription(namespace)] attribute to implicitly subscribe a grain to the stream with the corresponding id
  • How to configure Orleans Streams for use with Azure Event Hubs

An application using Orleans Streams with a non-Orleans publisher pushing to a stream which a grain consumes via a custom data adapter which tells Orleans how to interpret stream messages.

Demonstrates

  • How to use Orleans Streams
  • How to use the [ImplicitStreamSubscription(namespace)] attribute to implicitly subscribe a grain to the stream with the corresponding id
  • How to configure Orleans Streams for use with Azure Event Hubs
  • How to consume stream messages published by non-Orleans publishers by providing a custom EventHubDataAdapter implementation (a custom data adapter)