2
* Copyright (C) 2009 by Eric Herman <eric@freesa.org>
3
* Copyright (C) 2009 by Robert Stewart <robert@wombatnation.com>
4
* Copyright (C) 2009 by Eric Lambert <Eric.Lambert@sun.com>
5
* Use and distribution licensed under the
6
* GNU Lesser General Public License (LGPL) version 2.1.
7
* See the COPYING file in the parent directory for full text.
11
import gearmanij.Packet;
12
import gearmanij.util.IORuntimeException;
13
import java.io.IOException;
16
* This is essentially a copy of the the gearmanij.Connection interface.
20
* This interface exposes the API that classes representing connections to a
21
* Gearman Job Server must implement.
23
public interface GearmanJobServerConnection {
26
* Opens a connection to the Gearman Job Server
28
void open() throws IOException;
31
* Closes a connection to the Gearman Job Server
36
* Writes a {@link GearmanPacket} into the connection with the Gearman Job Server.
38
* @param request The request to be written.
40
void write(GearmanPacket request) throws IOException;
43
* Reads a {@link GearmanPacket} from the connection with the Gearman Job Server.
44
* @return the GearmanPacket read from the connection.
45
* @throws IORuntimeException if an I/O exception was encountered.
47
GearmanPacket read() throws IOException;