Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
😼

Mark Paluch mp911de

:octocat:
😼
View GitHub Profile
View MultithreadedExample.java
public class MultithreadedExample {
public static void main(String[] args) throws Exception{
// Syntax: redis://[password@]host[:port][/databaseNumber]
RedisClient redisClient = RedisClient.create(RedisURI.create("redis://localhost:6379/0"));
CountDownLatch latch = new CountDownLatch(1);
List<RedisThread> threads = IntStream.range(0, 100).mapToObj(ignore -> new RedisThread(redisClient, latch))
View R2dbcWithAkkaStreams.scala
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View Reproducer.java
import io.r2dbc.mssql.MssqlConnectionConfiguration;
import io.r2dbc.mssql.MssqlConnectionFactory;
public class Reproducer {
public static void main(String[] args) {
MssqlConnectionConfiguration config = MssqlConnectionConfiguration.builder()
.host("abcbookstore.database.windows.net")
.database("foo")
@mp911de
mp911de / HelloMySQL.java
Last active Oct 19, 2020
Spring Data R2DBC with MySQL via jasync-sql
View HelloMySQL.java
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mp911de
mp911de / Parameter.java
Created Mar 6, 2019
R2DBC Stored Procedures Proposal
View Parameter.java
/**
* OUT and IN/OUT parameter wrapper for stored procedures (callable functions).
*
* @param <T>
*/
class Parameter<T> {
@Nullable
private final T value;
@mp911de
mp911de / JdbcTransactionPlayground.java
Created Feb 2, 2019
Playing with Postgres and locking
View JdbcTransactionPlayground.java
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@mp911de
mp911de / TransactionPlayground.java
Created Jan 29, 2019
Transaction Playground for PostgreSQL to play how locks play with R2DBC.
View TransactionPlayground.java
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View Repro.java
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View ConnectionFactories.java
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View DemoApplicationSpringBootGh15311.java
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplicationSpringBootGh15311 {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);