use std::collections::HashMap;
use std::hash::Hash;
use std::sync::{Arc, RwLock};
pub struct Memoizer<K, V> {
store: RwLock<HashMap<K, Arc<V>>>,
# Basic Ractor usage
ractor = Ractor.new do
# This runs in parallel, isolated from main thread
result = heavy_computation
result
end
package com.example.orders;
public final class Order {
public static final Order POISON_PILL = new Order(-1L, 0.0);
use std::sync::mpsc::{self, SyncSender};
use std::sync::{Arc, Mutex};
use std::thread;
mod worker;
use worker::{Message, Worker};
module BoundedFanOut
Result = Struct.new(:value, :error) do
def ok?
error.nil?
end
end
use std::collections::HashMap;
use std::sync::{Arc, Mutex, PoisonError};
#[derive(Default)]
struct Metrics {
per_endpoint: HashMap<String, u64>,