Skip to content

Instantly share code, notes, and snippets.

View upeter's full-sized avatar

Urs upeter

  • Xebia BV
  • Netherlands
View GitHub Profile
@upeter
upeter / PeriodikBrokenTest.kt
Last active February 1, 2024 20:55
Test demonstrating that Periodik blocks Dispatcher Thread
package dev.akif.periodik
import dev.akif.periodik
import kotlinx.coroutines.*
import org.junit.jupiter.api.Timeout
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import kotlin.random.Random
import kotlin.reflect.KProperty
import kotlin.test.Test
@upeter
upeter / VirtualThreadExplanations.txt
Created June 30, 2023 07:39
Virtual Threads explanations
1) Which code is faster?
You said that when project Loom is implemented in Java 21 current projects (that are using sequential code) can benefit just by upgrading to Java 21.
Do you mean:
a) This counts for all code.
b) This counts for all multithreaded code.
c) This counts for all multithreaded code after it is rewritten to the virtual thread style.
if [ $# -eq 0 ]
then
echo -n "Enter amount of cluster nodes: "
read NODES
else
NODES=$1
fi
echo $NODES
@upeter
upeter / gist:27489c28a9e1b3392617
Last active August 29, 2015 14:06
GetOrCreateCookie with Spray
package com.material
import spray.routing.Route
import spray.routing.HttpServiceActor
import akka.actor.ActorSystem
import spray.http.HttpCookie
import akka.io.IO
import spray.can.Http
import akka.actor.Props
import java.util.UUID
@upeter
upeter / 0_reuse_code.js
Created June 14, 2014 07:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
package snippets
object DIExamples {
/*
* http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection-di.html
* http://debasishg.blogspot.com/2011/03/pushing-envelope-on-oo-and-functional.html
* http://www.assembla.com/wiki/show/liftweb/Dependency_Injection
*/