Azure / Azure/durabletask

Orchestration that receives multiple events

Aperta
#591 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
1.7k
Fork
335
Merge medio
2g 23h
PR unite (30g)
6

Descrizione

Can anyone share an example of an orchestration that receives multiple events?
I'm trying to create an orchestration that will wait for an event, process that event, and then wait for the next event, in an "endless" loop. Something along the lines of (NON WORKING CODE BELOW):
``` csharp
public class SignalOrchestration : TaskOrchestration
{
TaskCompletionSource resumeHandle;

public override async Task RunTask(OrchestrationContext context, string input)
{
do
{
string job = await WaitForSignal();
await context.ScheduleTask("ExecuteJob", string.Empty, job);
}
while (true);

return string.Empty;
}

async Task WaitForSignal()
{
this.resumeHandle = new TaskCompletionSource();
string data = await this.resumeHandle.Task;
return data;
}

public override void OnEvent(OrchestrationContext context, string name, string input)
{
this.resumeHandle?.SetResult(input);
}
}
```

and I should be able to send events to this orchestration.
The idea is to have something similar to an Actor - the orchestration representing a resource, and I'd like to handle the jobs on the resource as they arrive...

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

La issue menziona TaskOrchestration.RunTask e OnEvent, ma non indica file del repository né test. Inizia tracciando come vengono distribuiti gli eventi di orchestrazione e se il framework supporta attese durevoli ripetute per gli eventi, quindi confronta questo comportamento con il ciclo non funzionante fornito. Il risultato dovrebbe essere un esempio funzionante documentato oppure un percorso di implementazione con ambito esplicitamente definito per l’elaborazione di eventi successivi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
backend, distributed-systems
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.