/AzureSamples/Fabric/FsHelloFabric_WorkerRole/WorkerRole.fs

# · F# · 26 lines · 20 code · 6 blank · 0 comment · 0 complexity · 34a058725f66bae7553e53c2408ac632 MD5 · raw file

  1. namespace Microsoft.Samples.ServiceHosting.HelloFabric
  2. open System
  3. open System.Diagnostics
  4. open System.Threading
  5. open Microsoft.Samples.ServiceHosting.HelloFabric
  6. open Microsoft.WindowsAzure.Diagnostics
  7. open Microsoft.WindowsAzure.ServiceRuntime
  8. type WorkerRole() =
  9. inherit RoleEntryPoint()
  10. override wr.OnStart() =
  11. DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString") |> ignore
  12. base.OnStart()
  13. override wr.Run() =
  14. let dayTimerServer = new DayTimeTcpServer(RoleEnvironment.CurrentRoleInstance.InstanceEndpoints.["DayTime"].IPEndpoint)
  15. dayTimerServer.Start()
  16. let mutable count = 0
  17. while(true) do
  18. count <- count + 1
  19. Trace.WriteLine(String.Format("Message %d",count))
  20. Thread.Sleep(TimeSpan.FromSeconds(10.0))