rafaelnferreira / dtf-extended-samples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DTF Extended Samples

The goal of this repo is to provide non trivial usage examples of the DTF Framework in an minimalist (but realistic) Net Core Application, allowing developers to easily interact and learn the framework.

The application uses DTF AzureStorage as its backend/persistence mechanism and .Net DI to manage IOC.

List of orchestrations

Name Description Arguments - separated by ;
RetrieveFilmsOrchestration Uses the StarWarsAPI to retrieve a list of films where the supplied Star Wars character appears, the results are saved in the file system $CHARACTER_NAME;$FILE_NAME;$DELAY

Compiling the code

Clone the repo and build the solution using the CLI:

$ dotnet build

Use your favorite IDE.

Running the applications

The code base provides a server (TaskWorker) and a client.

An Azure Storage Account is required, create one via the Azure Portal and retrieve its connection string.

You can them either change the appsettings.json or setup your IDE/terminal with environment variables.

$ export DOTNET_ENVIRONMENT=development
$ export DTF__StorageAccountConnectionString="CONNECTION_STRING"

Running the server

Launch the server with the following command:

$ dotnet run server

Logs will be displayed by default.

Running the client

Orchestrations can be scheduled using the syntax: client --orchestration $NAME --argument $ARGS, for example:

$ dotnet run client --orchestration RetrieveFilmsOrchestration --argument "Luke;films-luke.json"

Discover and learn

  • Try running multiple instances of the server;
  • Kill the server during different occasions (while it is processing a task or the orchestration's control flow);
  • Disconnect from the internet;
  • Explore the code base;
  • Use Azure Storage Explorer to view
  • Create a new Orchestration;
  • Keep hacking :)

About

License:Apache License 2.0


Languages

Language:C# 100.0%