-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Assassyn/feature/infinit-run-in-cli
Feature/infinit run in cli
- Loading branch information
Showing
30 changed files
with
169 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Logging | ||
|
||
open Functional.ETL.Pipeline | ||
open PipelineResult | ||
open Lamar | ||
|
||
let logger (entity: PipelineProcessData<PipelineResult.UniversalHiveBotResutls>) = | ||
let lastMessage = entity.results.Head | ||
printfn "%O" lastMessage | ||
entity | ||
|
||
type ActionRegistry () as self = | ||
inherit ServiceRegistry () | ||
do | ||
self.For<Transformer<PipelineResult.UniversalHiveBotResutls>>().Use(logger).Named("decorator") |> ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,25 @@ | ||
open Configuration | ||
open Configuration | ||
open PipelineResult | ||
open Functional.ETL.Pipeline | ||
|
||
let printResults (processedData: PipelineProcessData<UniversalHiveBotResutls> array) = | ||
processedData | ||
|> Seq.collect (fun x -> x.results) | ||
|> Seq.iter (fun result -> printfn "%O" result) | ||
|
||
let getlastResult (entity:PipelineProcessData<UniversalHiveBotResutls>) = | ||
match entity.results.IsEmpty with | ||
| false -> Some entity.results.[^0] | ||
| _ -> None | ||
let action () = | ||
printfn "Starting UniveralHiveBot processs" | ||
let config = getConfiguration () | ||
|
||
let logger moduleName user token = | ||
printfn "%s: %s: %s" moduleName user token | ||
|
||
printfn "Starting UniveralHiveBot processs" | ||
|
||
let config = getConfiguration () | ||
|
||
match config.actions with | ||
| null -> | ||
printfn "no actions found" | ||
| _ -> | ||
printfn "found %i actions to execute" (config.actions |> Seq.length) | ||
let pipelines = createPipelines config logger | ||
pipelines | ||
|> Seq.iter (fun x -> processPipeline x |> ignore) | ||
|
||
printfn "Finshed UniveralHiveBot processs" | ||
match config.actions with | ||
| null -> | ||
"no actions found" | ||
| _ -> | ||
printfn "found %i actions to execute" (config.actions |> Seq.length) | ||
let pipelines = createPipelines config | ||
pipelines | ||
|> Seq.iter (fun x -> processPipeline x |> ignore) | ||
"Finshed UniveralHiveBot processs" | ||
|
||
let readlines = Seq.initInfinite (fun _ -> action()) | ||
|
||
let run item = | ||
item = "quit" | ||
|
||
Seq.find run readlines |> ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.