How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
| using System.Threading.Tasks; | |
| using Orleans; | |
| namespace MyApp | |
| { | |
| public class MyState | |
| { | |
| public string Foo { get; set; } | |
| public int Bar { get; set; } | |
| } |
| param ( | |
| [Int] | |
| $clusterSize, | |
| [string] | |
| $VMName, | |
| [Int] | |
| $nodeNumber, | |
| [Int] | |
| $IntIp, | |
| [Int] |
| public static class PipingExtensions | |
| { | |
| /// <summary> | |
| /// Take an object, pipe it into a function, and return the result. | |
| /// </summary> | |
| /// <typeparam name="T"></typeparam> | |
| /// <typeparam name="T2"></typeparam> | |
| /// <param name="obj"></param> | |
| /// <param name="f"></param> | |
| /// <returns></returns> |
| #time "on" | |
| #load "Bootstrap.fsx" | |
| open System | |
| open Akka.Actor | |
| open Akka.Configuration | |
| open Akka.FSharp | |
| open Akka.TestKit | |
| // #Using Actor |
| let CreateActor (ActorKey name) = | |
| MailboxProcessor.Start(fun mailbox -> | |
| let messageStore = GetMessageStore name | |
| let rec loop data = | |
| async { | |
| // Wait asynchronously until we get a message + reply channel | |
| let! message, replyWith = mailbox.Receive() | |
| match message with | |
| | Clear -> |
| // A connection to a Azure Service Bus-backed CloudAgent actor pool | |
| let cloudConnection = CloudConnection.ActorCloudConnection(ServiceBusConnection "Endpoint=sb://myservicebus.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=fsdoifsm0983m29048098dfs", Connections.Queue "myqueue") | |
| (* Posting messages - run this code on every producer *) | |
| let sendTo = ConnectionFactory.SendToActorPool CloudConnection | |
| let sendToIsaac = sendTo (ActorKey "isaac") | |
| sendToIsaac Clear |> Async.RunSynchronously // send a message to Clear the file to the Isaac actor | |
| sendToIsaac(Record { Text = "Hello"; Priority = Priority.Low }) |> Async.RunSynchronously // Send a new message to Isaac | |
| (* Consuming messages - run this code on every consumer *) |
| // Our simple domain model | |
| type Priority = | |
| | Low | |
| | Normal | |
| | High | |
| type Message = { | |
| Text : string | |
| Priority : Priority | |
| } |
| /// Code to bind mailbox processors to azure storage queues. | |
| module AzureMailboxProcessor | |
| open System | |
| module private Async = | |
| let AwaitTaskEmpty = Async.AwaitIAsyncResult >> Async.Ignore | |
| module private Option = | |
| let fromNullable (nullable:Nullable<_>) = if nullable.HasValue then Some nullable.Value else None | |
| let toNullable = function |
| type Stream = string | |
| type EventType = string | |
| type ExpectedVersion = int | |
| type EventData = byte[] | |
| type EventMetadata = byte[] | |
| type ResolveLinks = bool | |
| type From = int | |
| type BatchSize = int | |
| type BufferSize = int | |
| type CheckpointStore = (unit -> Async<int option>) * (int -> Async<unit>) |