View EventHandler.fs
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
// DEFINE PROCESSOR | |
type MyEventProcessorClient<'a>(blobContainer:BlobContainerClient,consumerGroup:string,connectionString:string,eventHubName:string,logger : ILogger<'a>,partitionID:string) = | |
inherit EventProcessorClient(blobContainer,consumerGroup,connectionString,eventHubName) | |
override __.ClaimOwnershipAsync(partitions:System.Collections.Generic.IEnumerable<_>, token:CancellationToken) = task { | |
return partitions |> Seq.filter (fun p -> p.PartitionId = partitionID) | |
} | |
View http.fs
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
let defaultRouter = router { | |
post "/newwish" (fun next (ctx: HttpContext) -> task { | |
let! message = ctx.ReadBodyFromRequestAsync() | |
let wish = { | |
OriginalMessage = message | |
} | |
let data = Newtonsoft.Json.JsonConvert.SerializeObject wish | |
let message = ServiceBusMessage data | |
do! serviceBusSender.Force().SendMessageAsync message |
View farmer.fs
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
containerEnvironment { | |
name "xmascontainers" | |
logAnalytics xmasLogs | |
add_containers [ | |
containerApp { | |
name "http" | |
activeRevisionsMode ActiveRevisionsMode.Single | |
docker_image containerRegistryDomain containerRegistry "http" version | |
replicas 1 5 | |
setting "ServiceBusQueueName" "wishrequests" |
View wbsocket.fs
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
let inline websocket<'Data> = | |
FunctionComponent.Of(fun (props: {| url : string; retryTimeSpan : TimeSpan; onConnected: bool -> unit; onMessage: 'Data -> unit |}) -> | |
let mutable currentlyConnected = false | |
let mutable wasAlreadyConnected = false | |
let connected = Hooks.useState false | |
let mutable webservice = null | |
let connect() = | |
if currentlyConnected then () else | |
let ws = WebSocket.Create(props.url) |
View socket.fs
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
FunctionComponent.Of(fun (props: {| url : string; retryTimeSpan : TimeSpan; onMessage: 'Data -> unit |}) -> | |
let connected = Hooks.useState(false) | |
let wasClosed = Hooks.useState(false) | |
let register() = | |
printfn "Trying to connect" | |
let ws = create props.url | |
ws.onclose <- unbox (fun _ -> | |
match ws.readyState with |
View farmer.lol
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
Deploying ARM template (please be patient, this can take a while)... | |
Unhandled exception. System.Exception: Azure Error: DeploymentActive | |
Message: Unable to edit or replace deployment 'farmer-deploy-2997': previous deployment from '6/2/2020 9:53:26 AM' is still active (expiration time is '6/9/2020 9:53:25 AM'). Please see https://aka.ms/arm-deploy for usage details. | |
at Farmer.Deploy.execute(String resourceGroupName, FSharpList`1 parameters, Deployment deployment) | |
at <StartupCode$Infrastructure>.$Program.main@() in /home/gitlab-runner/builds/e76ee70f/0/products/eCarApp/infrastructure/Program.fs:line 86 |
View errormessage.txt
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
JSON parsing failed on {"sourceType":"module","body":[{"specifiers":[{"imported":{"name":"toFail","type":"Identifier"},"local":{"name":"toFail","type":"Identifier"},"type":"ImportSpecifier"},{"imported":{"name":"toText","type":"Identifier"},"local":{"name":"toText","type":"Identifier"},"type":"ImportSpecifier"},{"imported":{"name":"printf","type":"Identifier"},"local":{"name":"printf","type":"Identifier"},"type":"ImportSpecifier"},{"imported":{"name":"validateGuid","type":"Identifier"},"local":{"name":"validateGuid","type":"Identifier"},"type":"ImportSpecifier"},{"imported":{"name":"join","type":"Identifier"},"local":{"name":"join","type":"Identifier"},"type":"ImportSpecifier"}],"source":{"value":"../fable-library.2.9.0/String.js","type":"StringLiteral"},"type":"ImportDeclaration"},{"specifiers":[{"imported":{"name":"int16ToString","type":"Identifier"},"local":{"name":"int16ToString","type":"Identifier"},"type":"ImportSpecifier"},{"imported":{"name":"mapCurriedArgs","type":"Identifier"},"local":{"name":"mapCu |
View conatiner.fs
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
let frontendService (operatorID:string) = webApp { | |
name (operatorID + "-frontend") | |
docker_image frontendImage frontendStartup | |
app_insights_off | |
link_to_service_plan appServicePlanName | |
setting "DOCKER_ENABLE_CI" "true" | |
setting "DOCKER_REGISTRY_SERVER_PASSWORD" dockerPassword | |
setting "DOCKER_REGISTRY_SERVER_URL" containerRegistryDomain | |
setting "DOCKER_REGISTRY_SERVER_USERNAME" containerRegistry |
View currying.fs
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
let withdrawWithAudit = withdraw |> auditAs "withdraw" Auditing.fileSystem | |
let depositWithAudit = deposit |> auditAs "deposit" Auditing.fileSystem | |
while true do | |
let action = | |
Console.WriteLine() | |
printfn "Current balance is £%M" account.Balance | |
Console.Write "(d)eposit, (w)ithdraw or e(x)it: " | |
Console.ReadLine() |
View paket.lock
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
GROUP AzureFunctions | |
STORAGE: NONE | |
RESTRICTION: == netcoreapp3.0 | |
NUGET | |
remote: https://api.nuget.org/v3/index.json | |
Braintree (4.16) | |
Newtonsoft.Json (>= 9.0.1) | |
System.Xml.XPath.XmlDocument (>= 4.3) | |
ExcelDataReader (3.6) | |
FSharp.Core (4.7) |
NewerOlder