i'm using Gearman to distribute different tasks and therefore i'm using java-gearman-service for implementing clients and workers.
however, i'm not able to figure out the data i receive in
GearmanJobEventCallback<T>::onEvent
:
how can i convert the event.getData()
byte array to the data i need? e.g. status or returned data? when i send status(3,10) it returns a byte array [51,0,49,48] - well that's not very useful to my client. unserializing with ObjectInputStream doesn't seem to be successful.
Same with the returned data of the work method, how can i "decode" that?
how can i "decode" the data
argument (byte array) from the work
method in GearmanFunction
?
Any input will be greatly appreciated!