SW.Serverless is an open-source .NET framework for building and running serverless adapters and services. It provides a runtime environment for executing .NET applications as serverless functions with process isolation and communication through stdin/stdout.
Package | Version | Downloads |
---|---|---|
SimplyWorks.Serverless |
||
SimplyWorks.Serverless.Sdk |
- SW.Serverless: Core serverless service library with dependency injection extensions for ASP.NET Core
-
SW.Serverless.Sdk: SDK for developing serverless adapters with the
Runner
class and logging utilities - SW.Serverless.SampleWeb: Example ASP.NET Core web application showing integration
- SW.Serverless.Installer: Command-line tool for packaging and deploying adapters to cloud storage
dotnet add package SimplyWorks.Serverless
dotnet add package SimplyWorks.Serverless.Sdk
// In Startup.cs or Program.cs
services.AddServerless();
using SW.Serverless.Sdk;
class Handler
{
public async Task<string> ProcessData(string input)
{
// Your serverless logic here
return $"Processed: {input}";
}
}
class Program
{
static async Task Main(string[] args) => await Runner.Run(new Handler());
}
- Process Isolation: Each adapter runs in its own process with timeout management
- Cloud Storage Integration: Support for AWS S3, Azure Storage, and Oracle Cloud
- Dependency Injection: Built-in integration with ASP.NET Core DI container
-
Logging: Structured logging support through
AdapterLogger
- Caching: Adapter metadata caching with configurable duration
- Version Management: Semantic versioning support for adapter deployments
The framework consists of:
- ServerlessService: Manages adapter lifecycle, installation, and invocation
- Runner: Entry point for adapter applications with command processing
- Installer: CLI tool for building and deploying adapter packages
- Cloud Storage: Abstraction layer for different cloud storage providers
For issues, questions, or contributions, please visit the GitHub repository.