ai.grakn.engine.rpc.GrpcServer Maven / Gradle / Ivy
/*
* Grakn - A Distributed Semantic Database
* Copyright (C) 2016-2018 Grakn Labs Limited
*
* Grakn is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Grakn is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Grakn. If not, see .
*/
package ai.grakn.engine.rpc;
import io.grpc.Server;
import java.io.IOException;
/**
* @author Felix Chapman
*/
public class GrpcServer implements AutoCloseable {
private final Server server;
private GrpcServer(Server server) {
this.server = server;
}
public static GrpcServer create(Server server) {
return new GrpcServer(server);
}
/**
* @throws IOException if unable to bind
*/
public void start() throws IOException {
server.start();
}
@Override
public void close() throws InterruptedException {
server.shutdown();
server.awaitTermination();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy