.NET Just Got Some Iron Behind It

IronWorker now supports .NET so you can run .NET code at scale. Let your .NET workers process big data, send massive notifications, collect data from API’s, schedule tasks, etc. All in the cloud, no servers required.

Here’s a quick Hello Worker example so you can see how easy it is to get started.

Write the Worker

This is just a simple worker that parses the task payload and prints it to the log.

Compile It

Compile it as you normally would with Visual Studio (or gmcs for mono users: gmcs hello.cs). You should now have a hello.exe executable.

Create .worker file

The .worker file defines the dependencies and since we only have an .exe file, that’s all we need to define.

 

Upload Worker

Now upload the code package:
> iron_worker upload hello

Queue Worker

Now that your worker is uploaded, you can start queuing up tasks! Let’s queue one from the command line:

> iron_worker queue hello –payload ‘{“query”:”xbox”}’
Generally, you’ll queue up tasks from your application and to do that, you just need to post to our create task endpoint in the IronWorker API, here’s example code for queuing tasks in .NET.

That’s it! Now you can queue up any number of jobs you want and IronWorker will handle the rest. Massive compute power at your fingertips.

Full code for this example here: https://github.com/iron-io/iron_worker_examples/tree/master/dotnet/hello_worker

Leave a Comment





This site uses Akismet to reduce spam. Learn how your comment data is processed.