Package org.gearman.common
Interface GearmanJobServerConnection
-
- All Known Subinterfaces:
GearmanJobServerIpConnection
- All Known Implementing Classes:
GearmanNIOJobServerConnection
public interface GearmanJobServerConnection
This interface exposes the API that classes representing connections to a Gearman Job Server must implement.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canRead()
Can a read operation be executed at this time.boolean
canWrite()
Can a write operation be executed at this time.void
close()
Closes a connection to the Gearman Job Server.boolean
isOpen()
Is the connection open.void
open()
Open the connection to the Gearman Job Server.GearmanPacket
read()
Reads aGearmanPacket
from the connection with the Gearman Job Server.void
write(GearmanPacket packet)
Writes aGearmanPacket
into the connection with the Gearman Job Server.
-
-
-
Method Detail
-
open
void open() throws IOException
Open the connection to the Gearman Job Server.- Throws:
IOException
- if an I/O exception was encountered.
-
close
void close()
Closes a connection to the Gearman Job Server.
-
write
void write(GearmanPacket packet) throws IOException
Writes aGearmanPacket
into the connection with the Gearman Job Server.- Parameters:
packet
- The request to be written.- Throws:
IOException
- if an I/O exception was encountered.
-
read
GearmanPacket read() throws IOException
Reads aGearmanPacket
from the connection with the Gearman Job Server.- Returns:
- the GearmanPacket read from the connection.
- Throws:
IOException
- if an I/O exception was encountered.
-
isOpen
boolean isOpen()
Is the connection open.- Returns:
- true if the connection is open, else false.
-
canRead
boolean canRead()
Can a read operation be executed at this time.- Returns:
- true if a read can be executed, else returns false.
-
canWrite
boolean canWrite()
Can a write operation be executed at this time.- Returns:
- true if a write can be executed, else returns false.
-
-