Skip to main content

.NET SDK Information

The Taskurai SDK is designed to make it easy to use Taskurai services from your applications. The SDK contains all the functionality to create tasks, follow up on tasks, and manage tasks.

This section contains some important topics about using the SDK correctly.

Thread Safety

Client Objects

All SDK client objects are thread-safe and independent of each other. This design ensures that reusing client instances is always safe, even across threads. The following example creates multiple tasks in different threads and is thread-safe:

foreach (var taskInput in taskInputList)
{
// Using clients from parallel threads
Task.Run(() =>
{
var createdTask = taskurai.CreateTask(createTaskInput);

Console.WriteLine(JsonSerializer.Serialize(createdTask, serializerOptions));
});
}

If your project is an Asp.Net Core application, you can use the TaskuraiClientFactory to create a Taskurai client. The factory's Create method can be called multiple times, resulting in a singleton Taskurai client.

Model Objects

Model objects used by SDK clients, whether input or output models, aren't thread-safe by default. To access the model from different threads, you must implement your own synchronization code.

Advanced Configuration

The Taskurai SDK builds upon the same foundations as the Azure .NET SDK. The SDK has built-in retry policies to counter network or service failures and provide a more robust experience.

The advanced settings can be set when constructing a new Taskurai client using the TaskuraiClientOptions.