-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
40 lines (35 loc) · 1.44 KB
/
Program.cs
File metadata and controls
40 lines (35 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Threading;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace RESTfulFish
{
public class Program
{
public static void Main(string[] args)
{
/* Still need to determine if this is a good viable option
* CreateHostBuilder(args).Build().Run();
*/
Misc.LogInRESTfulFish();
// RESTfulFish needs to be logged into Fishbowl server indefinitely, so start a second and third thread.
// This needs to come after logging into Fishbowl.
ThreadStart KeepAliveRef = new ThreadStart(Misc.KeepAlive);
Thread KeepAliveThread = new Thread(KeepAliveRef);
KeepAliveThread.Start();
ThreadStart WatchDogtRef = new ThreadStart(Misc.WatchDog);
Thread WatchDogThread = new Thread(WatchDogtRef);
WatchDogThread.Start();
// Let the fish eat grapes! (start Grapevine REST HTTP server)
ThreadStart GrapeRef = new ThreadStart(Grapes.StartGrapevineServer);
Thread GrapeThread = new Thread(GrapeRef);
GrapeThread.Start();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Worker>();
});
}
}