Files
bitminer/Worker/Program.cs
Tommy Parnell 414395b87d init
2017-01-11 21:29:12 -05:00

30 lines
962 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Net.Http;
using System.Text;
namespace Worker
{
public class Program
{
static HttpClient httpclient = new HttpClient();
public static void Main(string[] args)
{
MainAsync(args).Wait();
}
public static async Task MainAsync(string[] args)
{
while(true)
{
var bytes = await httpclient.GetByteArrayAsync("http://gen/8");
var results = await httpclient.PostAsync("http://hashr/hashme", new ByteArrayContent(bytes));
results.EnsureSuccessStatusCode();
var hashResults = await results.Content.ReadAsStringAsync();
var dbResult = await httpclient.GetStringAsync($"http://store/store?dt={DateTime.Now.ToString()}");
await Task.Delay(1000);
}
}
}
}