From 90f2fd21e897cc2d1b6498589458572f45856119 Mon Sep 17 00:00:00 2001 From: Alex Zylman Date: Mon, 30 Dec 2013 14:14:19 -0800 Subject: [PATCH 1/2] expose job handle/uniqueId --- worker/inpack.go | 8 ++++++++ worker/job.go | 2 ++ 2 files changed, 10 insertions(+) diff --git a/worker/inpack.go b/worker/inpack.go index 68d9928..3a18e46 100644 --- a/worker/inpack.go +++ b/worker/inpack.go @@ -24,6 +24,14 @@ func (inpack *inPack) Data() []byte { return inpack.data } +func (inpack *inPack) Handle() string { + return inpack.handle +} + +func (inpack *inPack) UniqueId() string { + return inpack.uniqueId +} + func (inpack *inPack) Err() error { if inpack.dataType == dtError { return getError(inpack.data) diff --git a/worker/job.go b/worker/job.go index d2d7d6f..7ef28de 100644 --- a/worker/job.go +++ b/worker/job.go @@ -6,4 +6,6 @@ type Job interface { SendWarning(data []byte) SendData(data []byte) UpdateStatus(numerator, denominator int) + Handle() string + UniqueId() string } From 94b00affec57710fb05b1202dd7c98c8421c5cc9 Mon Sep 17 00:00:00 2001 From: jake Date: Fri, 3 Jan 2014 15:58:18 -0500 Subject: [PATCH 2/2] Bring back ability to get function name --- worker/inpack.go | 4 ++++ worker/job.go | 1 + 2 files changed, 5 insertions(+) diff --git a/worker/inpack.go b/worker/inpack.go index 3a18e46..abb7516 100644 --- a/worker/inpack.go +++ b/worker/inpack.go @@ -24,6 +24,10 @@ func (inpack *inPack) Data() []byte { return inpack.data } +func (inpack *inPack) Fn() string { + return inpack.fn +} + func (inpack *inPack) Handle() string { return inpack.handle } diff --git a/worker/job.go b/worker/job.go index 7ef28de..3d6904f 100644 --- a/worker/job.go +++ b/worker/job.go @@ -3,6 +3,7 @@ package worker type Job interface { Err() error Data() []byte + Fn() string SendWarning(data []byte) SendData(data []byte) UpdateStatus(numerator, denominator int)