Giter Site home page Giter Site logo

eigr / spawn-dart Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 1.0 100 KB

Dart SDK for Spawn applications

License: Apache License 2.0

Dart 99.55% Dockerfile 0.33% Makefile 0.12%
actor-model actors dartlang durable-computing-model durable-functions elixir erlang serverless stateful-actors

spawn-dart's Introduction

Spawn Dart SDK

Dart User Language Support for Spawn.

Table of Contents

  1. Overview
  2. Getting Started

Overview

Spawn is a Stateful Serverless Runtime and Framework basead on the Actor Model and operates as a Service Mesh.

Spawn's main goal is to remove the complexity in developing services or microservices, providing simple and intuitive APIs, as well as a declarative deployment and configuration model and based on a Serverless architecture and Actor Model. This leaves the developer to focus on developing the business domain while the platform deals with the complexities and infrastructure needed to support the scalable, resilient, distributed, and event-driven architecture that modern systems requires.

Spawn is based on the sidecar proxy pattern to provide a polyglot Actor Model framework and platform. Spawn's technology stack, built on the BEAM VM (Erlang's virtual machine) and OTP, provides support for different languages from its native Actor model.

For more information consult the main repository documentation.

Getting Started

TODO

syntax = "proto3";

package domain;

message State {
  repeated string languages = 1;
}

message Request {
  string language = 1;
}

message Reply {
  string response = 1;
}
import 'package:spawn_app_example/src/generated/protos/domain.pb.dart';
import 'package:spawn_dart/spawn_dart.dart';

@StatefulNamedActor(
  'joe',
  State,
)
class JoeActor {
  @Action()
  Value setLanguage(Request request, Context ctx) {
    if (ctx.getState().isPresent) {
      var currentState = ctx.getState().value as State;
      print("Current state is $currentState");
    }

    return Value()
      ..withReponse(Reply.create()..response = "dart")
      ..withState(State.create()..languages.addAll(["erlang, dart"]));
  }
}
import 'package:spawn_app_example/joe_actor.dart';
import 'package:spawn_dart/spawn_dart.dart';

void main() {
  SpawnSystem()
      .create("spawn-system")
      .withPort(8091)
      .withStatefulNamedActor(JoeActor)
      .start();
}

spawn-dart's People

Contributors

sleipnir avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

sleipnir

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.