This file contains hidden or 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 java.util.concurrent.*; | |
public class ThreadPoolTest { | |
public static void main(String[] args) { | |
BlockingQueue<Runnable> queue = new SynchronousQueue<>(); | |
ExecutorService threadPool = new LoggingThreadPoolExecutor(1, 10, 30, TimeUnit.SECONDS, queue, new BlockingRejectedExecutionHandler()); | |
for (int i = 0; i < 1000; i++) { | |
threadPool.submit(() -> { |
This file contains hidden or 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 java.util.concurrent.*; | |
public class ThreadPoolTest { | |
public static void main(String[] args) { | |
BlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(64); | |
ExecutorService threadPool = new LoggingThreadPoolExecutor(1, 10, 30, TimeUnit.SECONDS, queue); | |
for (int i = 0; i < 1000; i++) { | |
threadPool.submit(() -> { |
This file contains hidden or 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
public class Main { | |
public static void main(String[] args) throws Exception { | |
ConnectionFactory cf = new ConnectionFactory(Constants.DEFAULT_URL); | |
final Connection conn = cf.createConnection(); | |
conn.subscribe("foo", new MessageHandler() { | |
@Override | |
public void onMessage(Message message) { | |
conn.publish("bar", "hello".getBytes()); | |
} |
This file contains hidden or 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
func BenchmarkInsertMulti(b *testing.B) { | |
ctrie := New(nil) | |
b.ResetTimer() | |
for i := 0; i < b.N; i++ { | |
for j := 0; j < 1000000; j++ { | |
ctrie.Insert([]byte(strconv.Itoa(j)), 0) | |
} | |
} | |
} |
This file contains hidden or 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
package goplus | |
import ( | |
"fmt" | |
"math/rand" | |
"net/http" | |
"strconv" | |
"github.com/Workiva/go-rest/rest" | |
) |
This file contains hidden or 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
{ | |
"name": "w-message-client", | |
"version": "0.0.1", | |
"dependencies": { | |
"sockjs-client": "~0.3.4", | |
"requirejs": "~2.1.15" | |
} | |
} |
This file contains hidden or 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
package main | |
import ( | |
"time" | |
"github.com/tylertreat-wf/vessel/vessel" | |
) | |
func main() { | |
vessel := vessel.NewSockJSVessel("/vessel") |