roc-lang / basic-webserver

A basic webserver in Roc
https://roc-lang.github.io/basic-webserver/
Universal Permissive License v1.0
72 stars 15 forks source link

WIP add Effect for a KV cache #17

Closed lukewilliamboswell closed 1 month ago

lukewilliamboswell commented 6 months ago

The next step I think is to implement the store using something like

# This is a temporary implementation until effect interpreters are implemented 
fn get_global_hashmap() -> MutexGuard<'static, HashMap<String, u16>> {
    static map: OnceLock<Mutex<HashMap<String, u16>>> = OnceLock::new();
    map.get_or_init(|| Mutex::new(HashMap::new()))
        .lock()
        .expect("Let's hope the lock isn't poisoned")
}
lukewilliamboswell commented 1 month ago

Closing this as no longer planned.