Skip to content

Instantly share code, notes, and snippets.

@explorer14
Last active June 10, 2018 11:51
Embed
What would you like to do?
public class TriggeredOrchestrationProcess
{
public ctor(IDoSomethingFilter doSomethingFilter,
IPipe<DoSomethingMessage> pipe)
{
// take in the dependencies
this.doSomethingFilter = doSomethingFilter
this.pipe = pipe
}
// this will be automatically triggered as soon
// as a message is recieved on the queue that this WebJob
// is listening on.
public void QueueTrigger(string message)
{
// parse the message read from the queue
var inputData = DeserialiseFromJson(message)
// pass the parsed input data to the filter to do some processing
var result = doSomethingFilter.DoSomething(inputData)
// finally, write it out to a pipe (for e.g. queue) for the next
// step in the process.
pipe.Write(result)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment