-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add READMEs to NuGet packages #9513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
f1c630a
Add READMEs to core packages
Copilot bc2dc2b
Add READMEs to more packages
Copilot b0c998f
Add READMEs for Azure storage and streaming providers
Copilot 7761ea3
Add READMEs for AdoNet providers and EventSourcing
Copilot 304df3c
Revert global.json changes
Copilot 99171f4
Add READMEs for all Azure packages
Copilot c8eb0e1
Add READMEs for all AWS packages
Copilot 730de8c
Add READMEs for all Redis packages
Copilot b6dba18
Add READMEs for remaining AdoNet packages
Copilot bc083c0
Add READMEs for all serialization packages
Copilot ccd80be
Update READMEs based on PR review feedback
Copilot 635e9f5
Update READMEs to include complete samples with grain references, cal…
Copilot a2ae730
Remove ConfigureApplicationParts and ClusterOptions calls from READMEs
Copilot d882ddd
Add grain interface and implementation definitions to READMEs
Copilot 0d20445
Move using directives before type definitions in README files
Copilot aef4678
Update reminder TimeSpans to be greater than 1 minute
Copilot e787282
Remove commented out grain implementation and Serializable attribute
Copilot 4e16ea2
Remove commented out grain implementation from Azure Storage Clusteri…
Copilot 8635d15
Remove commented-out code from Orleans.Client README
Copilot 05d52ae
Update READMEs to use file-scoped namespaces, Host.CreateApplicationB…
Copilot 0da1485
Update all READMEs with file-scoped namespaces, Host.CreateApplicatio…
Copilot 4208d4f
Remove duplicate PackageReadmeFile directives from csproj files
Copilot 4dcd1e8
Remove timer field and improve DynamoDB Reminders README example
Copilot 2294638
Remove timer field and improve example in Orleans.Reminders.AdoNet RE…
Copilot 71656f1
Update Orleans.Journaling.AzureStorage README with improved ShoppingC…
Copilot 9ba5e3e
Remove unnecessary timer field and add missing grain interface defini…
Copilot ccae5b5
Update Orleans.Serialization.TestKit README with better examples
Copilot 31c00b7
Update READMEs with correct method usage
Copilot 3eb79b3
Updated grain directory method names and removed timer field
Copilot adc3e22
Update READMEs to address review comments
Copilot 9068824
Fix Orleans.Clustering.Cosmos and Orleans.Streaming.AzureStorage READMEs
Copilot 03edc48
Add [<Id(xu)>] attributes to F# record and DU examples
Copilot 5df2b52
Remove SerializerTester example from Orleans.Serialization.TestKit RE…
Copilot 6a1eb9c
Update Orleans.Serialization.Protobuf README to use correct serialize…
Copilot 43172bb
Updated MessagePack serializer configuration example
Copilot 853f6be
Updated NewtonsoftJson serializer configuration example
Copilot 618fc26
Updated SystemTextJson serializer configuration example
Copilot 5d48fab
Fix csproj files to properly enclose all ItemGroup elements within Pr…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Microsoft Orleans Clustering for DynamoDB | ||
|
|
||
| ## Introduction | ||
| Microsoft Orleans Clustering for DynamoDB provides cluster membership functionality for Microsoft Orleans using Amazon's DynamoDB. This allows Orleans silos to coordinate and form a cluster using DynamoDB as the backing store. | ||
|
|
||
| ## Getting Started | ||
| To use this package, install it via NuGet: | ||
|
|
||
| ```shell | ||
| dotnet add package Microsoft.Orleans.Clustering.DynamoDB | ||
| ``` | ||
|
|
||
| ## Example - Configuring DynamoDB Membership | ||
| ```csharp | ||
| using Microsoft.Extensions.Hosting; | ||
| using Orleans.Hosting; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using System; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace ExampleGrains; | ||
|
|
||
| // Define a grain interface | ||
| public interface IHelloGrain : IGrainWithStringKey | ||
| { | ||
| Task<string> SayHello(string greeting); | ||
| } | ||
|
|
||
| // Implement the grain interface | ||
| public class HelloGrain : Grain, IHelloGrain | ||
| { | ||
| public Task<string> SayHello(string greeting) | ||
| { | ||
| return Task.FromResult($"Hello, {greeting}!"); | ||
| } | ||
| } | ||
|
|
||
| var builder = Host.CreateApplicationBuilder(args) | ||
| .UseOrleans(siloBuilder => | ||
| { | ||
| siloBuilder | ||
| // Configure DynamoDB clustering | ||
| .UseDynamoDBClustering(options => | ||
| { | ||
| options.AccessKey = "YOUR_AWS_ACCESS_KEY"; | ||
| options.SecretKey = "YOUR_AWS_SECRET_KEY"; | ||
| options.Region = "us-east-1"; | ||
| options.TableName = "OrleansClusteringTable"; | ||
| options.CreateIfNotExists = true; | ||
| }); | ||
| }); | ||
|
|
||
| var host = builder.Build(); | ||
| await host.StartAsync(); | ||
|
|
||
| // Get a reference to a grain and call it | ||
| var client = host.Services.GetRequiredService<IClusterClient>(); | ||
| var grain = client.GetGrain<IHelloGrain>("user123"); | ||
| var response = await grain.SayHello("DynamoDB"); | ||
|
|
||
| // Print the result | ||
| Console.WriteLine($"Grain response: {response}"); | ||
|
|
||
| // Keep the host running until the application is shut down | ||
| await host.WaitForShutdownAsync(); | ||
| ``` | ||
|
|
||
| ## Documentation | ||
| For more comprehensive documentation, please refer to: | ||
| - [Microsoft Orleans Documentation](https://learn.microsoft.com/dotnet/orleans/) | ||
| - [Configuration Guide](https://learn.microsoft.com/en-us/dotnet/orleans/host/configuration-guide/) | ||
| - [Orleans Clustering](https://learn.microsoft.com/en-us/dotnet/orleans/implementation/cluster-management) | ||
| - [AWS SDK for .NET Documentation](https://docs.aws.amazon.com/sdk-for-net/index.html) | ||
|
|
||
| ## Feedback & Contributing | ||
| - If you have any issues or would like to provide feedback, please [open an issue on GitHub](https://github.com/dotnet/orleans/issues) | ||
| - Join our community on [Discord](https://aka.ms/orleans-discord) | ||
| - Follow the [@msftorleans](https://twitter.com/msftorleans) Twitter account for Orleans announcements | ||
| - Contributions are welcome! Please review our [contribution guidelines](https://github.com/dotnet/orleans/blob/main/CONTRIBUTING.md) | ||
| - This project is licensed under the [MIT license](https://github.com/dotnet/orleans/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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # Microsoft Orleans Persistence for DynamoDB | ||
|
|
||
| ## Introduction | ||
| Microsoft Orleans Persistence for DynamoDB provides grain persistence for Microsoft Orleans using Amazon's DynamoDB. This allows your grains to persist their state in DynamoDB and reload it when they are reactivated. | ||
|
|
||
| ## Getting Started | ||
| To use this package, install it via NuGet: | ||
|
|
||
| ```shell | ||
| dotnet add package Microsoft.Orleans.Persistence.DynamoDB | ||
| ``` | ||
|
|
||
| ## Example - Configuring DynamoDB Persistence | ||
| ```csharp | ||
| using Microsoft.Extensions.Hosting; | ||
| using Orleans.Configuration; | ||
| using Orleans.Hosting; | ||
|
|
||
| var builder = Host.CreateApplicationBuilder(args) | ||
| .UseOrleans(siloBuilder => | ||
| { | ||
| siloBuilder | ||
| .UseLocalhostClustering() | ||
| // Configure DynamoDB as grain storage | ||
| .AddDynamoDBGrainStorage( | ||
| name: "dynamoStore", | ||
| configureOptions: options => | ||
| { | ||
| options.AccessKey = "YOUR_AWS_ACCESS_KEY"; | ||
| options.SecretKey = "YOUR_AWS_SECRET_KEY"; | ||
| options.Region = "us-east-1"; | ||
| options.TableName = "OrleansGrainState"; | ||
| options.CreateIfNotExists = true; | ||
| }); | ||
| }); | ||
|
|
||
| // Run the host | ||
| await builder.RunAsync(); | ||
| ``` | ||
|
|
||
| ## Example - Using Grain Storage in a Grain | ||
| ```csharp | ||
| // Define grain state class | ||
|
|
||
| public class MyGrainState | ||
| { | ||
| public string Data { get; set; } | ||
| public int Version { get; set; } | ||
| } | ||
|
|
||
| // Grain implementation that uses the DynamoDB storage | ||
| public class MyGrain : Grain, IMyGrain, IGrainWithStringKey | ||
| { | ||
| private readonly IPersistentState<MyGrainState> _state; | ||
|
|
||
| public MyGrain([PersistentState("state", "dynamoStore")] IPersistentState<MyGrainState> state) | ||
| { | ||
| _state = state; | ||
| } | ||
|
|
||
| public async Task SetData(string data) | ||
| { | ||
| _state.State.Data = data; | ||
| _state.State.Version++; | ||
| await _state.WriteStateAsync(); | ||
| } | ||
|
|
||
| public Task<string> GetData() | ||
| { | ||
| return Task.FromResult(_state.State.Data); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Documentation | ||
| For more comprehensive documentation, please refer to: | ||
| - [Microsoft Orleans Documentation](https://learn.microsoft.com/dotnet/orleans/) | ||
| - [Grain Persistence](https://learn.microsoft.com/en-us/dotnet/orleans/grains/grain-persistence) | ||
| - [AWS SDK for .NET Documentation](https://docs.aws.amazon.com/sdk-for-net/index.html) | ||
|
|
||
| ## Feedback & Contributing | ||
| - If you have any issues or would like to provide feedback, please [open an issue on GitHub](https://github.com/dotnet/orleans/issues) | ||
| - Join our community on [Discord](https://aka.ms/orleans-discord) | ||
| - Follow the [@msftorleans](https://twitter.com/msftorleans) Twitter account for Orleans announcements | ||
| - Contributions are welcome! Please review our [contribution guidelines](https://github.com/dotnet/orleans/blob/main/CONTRIBUTING.md) | ||
| - This project is licensed under the [MIT license](https://github.com/dotnet/orleans/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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # Microsoft Orleans Reminders for DynamoDB | ||
|
|
||
| ## Introduction | ||
| Microsoft Orleans Reminders for DynamoDB provides persistence for Orleans reminders using Amazon's DynamoDB. This allows your Orleans applications to schedule persistent reminders that will be triggered even after silo restarts or grain deactivation. | ||
|
|
||
| ## Getting Started | ||
| To use this package, install it via NuGet: | ||
|
|
||
| ```shell | ||
| dotnet add package Microsoft.Orleans.Reminders.DynamoDB | ||
| ``` | ||
|
|
||
| ## Example - Configuring DynamoDB Reminders | ||
| ```csharp | ||
| using Microsoft.Extensions.Hosting; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using Orleans.Configuration; | ||
| using Orleans.Hosting; | ||
|
|
||
| var builder = Host.CreateApplicationBuilder(args) | ||
| .UseOrleans(siloBuilder => | ||
| { | ||
| siloBuilder | ||
| .UseLocalhostClustering() | ||
| // Configure DynamoDB as reminder storage | ||
| .UseDynamoDBReminderService(options => | ||
| { | ||
| options.AccessKey = "YOUR_AWS_ACCESS_KEY"; | ||
| options.SecretKey = "YOUR_AWS_SECRET_KEY"; | ||
| options.Region = "us-east-1"; | ||
| options.TableName = "OrleansReminders"; | ||
| options.CreateIfNotExists = true; | ||
| }); | ||
| }); | ||
|
|
||
| // Run the host | ||
| var host = builder.Build(); | ||
| await host.StartAsync(); | ||
|
|
||
| // Get a reference to the grain | ||
| var reminderGrain = host.Services.GetRequiredService<IGrainFactory>() | ||
| .GetGrain<IReminderGrain>("my-reminder-grain"); | ||
|
|
||
| // Start the reminder | ||
| await reminderGrain.StartReminder("ExampleReminder"); | ||
| Console.WriteLine("Reminder started!"); | ||
|
|
||
| // Keep the host running until the application is shut down | ||
| await host.WaitForShutdownAsync(); | ||
| ``` | ||
|
|
||
| ## Example - Using Reminders in a Grain | ||
| ```csharp | ||
| using System; | ||
| using System.Threading.Tasks; | ||
| using Orleans; | ||
| using Orleans.Runtime; | ||
|
|
||
| namespace ReminderExample; | ||
|
|
||
| public interface IReminderGrain : IGrainWithStringKey | ||
| { | ||
| Task StartReminder(string reminderName); | ||
| Task StopReminder(); | ||
| } | ||
|
|
||
| public class ReminderGrain : Grain, IReminderGrain, IRemindable | ||
| { | ||
| private string _reminderName = "MyReminder"; | ||
|
|
||
| public async Task StartReminder(string reminderName) | ||
| { | ||
| _reminderName = reminderName; | ||
|
|
||
| // Register a persistent reminder | ||
| await RegisterOrUpdateReminder( | ||
| reminderName, | ||
| TimeSpan.FromMinutes(2), // Time to delay before the first tick (must be > 1 minute) | ||
| TimeSpan.FromMinutes(5)); // Period of the reminder (must be > 1 minute) | ||
| } | ||
|
|
||
| public async Task StopReminder() | ||
| { | ||
| // Find and unregister the reminder | ||
| var reminder = await GetReminder(_reminderName); | ||
| if (reminder != null) | ||
| { | ||
| await UnregisterReminder(reminder); | ||
| } | ||
| } | ||
|
|
||
| public Task ReceiveReminder(string reminderName, TickStatus status) | ||
| { | ||
| // This method is called when the reminder ticks | ||
| Console.WriteLine($"Reminder {reminderName} triggered at {DateTime.UtcNow}. Status: {status}"); | ||
| return Task.CompletedTask; | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Documentation | ||
| For more comprehensive documentation, please refer to: | ||
| - [Microsoft Orleans Documentation](https://learn.microsoft.com/dotnet/orleans/) | ||
| - [Reminders and Timers](https://learn.microsoft.com/en-us/dotnet/orleans/grains/timers-and-reminders) | ||
| - [Reminder Services](https://learn.microsoft.com/en-us/dotnet/orleans/implementation/reminder-services) | ||
| - [AWS SDK for .NET Documentation](https://docs.aws.amazon.com/sdk-for-net/index.html) | ||
|
|
||
| ## Feedback & Contributing | ||
| - If you have any issues or would like to provide feedback, please [open an issue on GitHub](https://github.com/dotnet/orleans/issues) | ||
| - Join our community on [Discord](https://aka.ms/orleans-discord) | ||
| - Follow the [@msftorleans](https://twitter.com/msftorleans) Twitter account for Orleans announcements | ||
| - Contributions are welcome! Please review our [contribution guidelines](https://github.com/dotnet/orleans/blob/main/CONTRIBUTING.md) | ||
| - This project is licensed under the [MIT license](https://github.com/dotnet/orleans/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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure that 'using' directives and namespace declarations come before any type definitions or other code... update this for all files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved all using directives and namespace declarations to come before any type definitions in all README files. The changes are in commit 1ed1905.