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 the types for the inputs and outputs | |
type AccountID = AccountID of int | |
type Balance = Balance of decimal | |
type Deposit = Deposit of AccountID * decimal | |
type NewBalance = NewBalance of decimal | |
type LogMessage = string | |
// Define an error type for your operations | |
type BankError = | |
| AccountNotFound of int |
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
type ExecuteCallback = ExecuteCallback | |
// Actor that executes the timer callback | |
type CallbackActor(callback: TimerCallback, state: obj) = | |
inherit UntypedActor() | |
override x.OnReceive(message: obj) = | |
match message with | |
| :? ExecuteCallback -> | |
try |
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
using System; | |
using System.Buffers; | |
using System.Runtime.CompilerServices; | |
using System.Collections.Generic; | |
using System.Threading; | |
var allocatedArrays = new HashSet<int>(); // To track allocated arrays | |
int i = 0; | |
while (true) | |
{ |
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
module AlarmsGlobal.Command.Domain.User | |
open CQRS | |
open Akkling | |
open Akkling.Persistence | |
open AkklingHelpers | |
open Akka | |
open Common | |
open Serilog | |
open System |
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
open System.Threading | |
let taskGrandchild(order: int) : Async<unit> = | |
async { | |
printfn $"Starting Grandchild({order})" | |
let! ct = Async.CancellationToken | |
printfn $"Cancellation token GrandChild({order}): {ct.GetHashCode()}" | |
// use! c = Async.OnCancel(fun () -> printfn $"Cancelled Task Grandchild: {order}") |
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 the types for the inputs and outputs | |
type AccountID = AccountID of int | |
type Balance = Balance of decimal | |
type Deposit = Deposit of AccountID * decimal | |
type LogMessage = string | |
// Define an error type for your operations | |
type BankError = | |
| AccountNotFound of int | |
| InsufficientFunds of decimal |
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
import { useRef, useState } from "react"; | |
import ReactDOM from "react-dom"; | |
import { createRoot } from 'react-dom/client' | |
import { Canvas, MeshProps, useFrame } from '@react-three/fiber' | |
import { Mesh } from "three"; | |
import React from "react"; | |
function Box(props) { | |
// This reference will give us direct access to the mesh | |
const mesh = useRef<Mesh>(null!) |
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
namespace Lit | |
open System | |
open Fable.Core | |
open Fable.Core.JsInterop | |
open Fable.React | |
open Browser.Types | |
open Lit | |
/// <summary> |
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
module Fable.Elmish.Nile | |
open Elmish | |
open FSharp.Control | |
open FSharp.Control.Core | |
[<RequireQualifiedAccess>] | |
module Program = | |
/// Uses `stream` to transform a stream of messages dispatched from the view | |
/// and a stream of updates to a stream of messages dispatched to `update`. | |
/// `stream` is only called once. |
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
module Command.Serialization | |
open Command | |
open System | |
open Akkling | |
open Akkling.Persistence | |
open Akka.Cluster.Tools.PublishSubscribe | |
open Akka | |
open Akka.Cluster.Sharding | |
open Akkling.Cluster.Sharding |
NewerOlder