diff --git a/README.md b/README.md index 3d593a7..a4388e1 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ import ( func main() { // flume avro instance address - client, err := avroipc.NewClient("localhost:20200", 0, 1024, 6) + client, err := avroipc.NewClient("localhost:20200", 0, 0, 1024, 6) if err != nil { log.Fatal(err) } diff --git a/client.go b/client.go index 231bc6e..76cac34 100644 --- a/client.go +++ b/client.go @@ -9,7 +9,7 @@ import ( type Client interface { Close() error Append(event *Event) (string, error) - AppendBatch(event []*Event) (string, error) + AppendBatch(events []*Event) (string, error) } type client struct { @@ -22,8 +22,8 @@ type client struct { } // NewClient creates an avro Client, and connect to addr immediately -func NewClient(addr string, sendTimeout time.Duration, bufferSize, compressionLevel int) (Client, error) { - trans, err := NewSocket(addr) +func NewClient(addr string, timeout, sendTimeout time.Duration, bufferSize, compressionLevel int) (Client, error) { + trans, err := NewSocketTimeout(addr, timeout) if err != nil { return nil, err } diff --git a/ipc_test.go b/ipc_test.go index 37ec954..3404e2d 100644 --- a/ipc_test.go +++ b/ipc_test.go @@ -27,10 +27,12 @@ func TestSend(t *testing.T) { } bufferSize := 8 + + timeout := time.Duration(0) sendTimeout := time.Duration(0) // flume avro instance address - client, err := NewClient(addr, sendTimeout, bufferSize, levelInt) + client, err := NewClient(addr, timeout, sendTimeout, bufferSize, levelInt) require.NoError(t, err) event := &Event{