All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickhouse.r2dbc.connection.ClickHouseConnectionFactory Maven / Gradle / Ivy

There is a newer version: 0.7.1-patch1
Show newest version
package com.clickhouse.r2dbc.connection;

import java.util.function.Function;

import com.clickhouse.client.ClickHouseNode;
import com.clickhouse.client.ClickHouseNodeSelector;
import io.r2dbc.spi.Connection;
import io.r2dbc.spi.ConnectionFactory;
import io.r2dbc.spi.ConnectionFactoryMetadata;
import reactor.core.publisher.Mono;

public class ClickHouseConnectionFactory implements ConnectionFactory {
    private final Function nodes;

    ClickHouseConnectionFactory(Function nodes) {
        this.nodes = nodes;
    }

    @Override
    public Mono create() {
        return Mono.just(new ClickHouseConnection(nodes));
    }

    @Override
    public ConnectionFactoryMetadata getMetadata() {
        return ClickHouseConnectionFactoryMetadata.INSTANCE;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy