From be74dc86b12078732a5950b95993d8730dae5698 Mon Sep 17 00:00:00 2001 From: Arman Kamal Date: Sat, 9 Apr 2016 23:38:03 +0600 Subject: [PATCH] Remote Queue Implementation Completed --- belt/queue-remote.go | 7 +++++-- rpc/queue.go | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/belt/queue-remote.go b/belt/queue-remote.go index 8429ce3..38c14ab 100644 --- a/belt/queue-remote.go +++ b/belt/queue-remote.go @@ -28,8 +28,11 @@ func NewRemoteQueue(addr string) (*RemoteQueue, error) { }, nil } -func (q *RemoteQueue) Push(*data.Execution) error { - panic("unimplemented") +func (q *RemoteQueue) Push(exec *data.Execution) error { + var abc interface{} + err := q.c.Call("Queue.Push", exec, abc) + + return err } func (q *RemoteQueue) Pop(wait bool) (*Execution, error) { diff --git a/rpc/queue.go b/rpc/queue.go index 0326f2a..a0b205f 100644 --- a/rpc/queue.go +++ b/rpc/queue.go @@ -11,6 +11,11 @@ import ( type Queue struct{} +func (q *Queue) Push(exec *data.Execution, reply *interface{}) error { + err := belt.Queue.Push(exec) + return err +} + func (q *Queue) Pop(args int, reply *data.Execution) error { exec, err := belt.Queue.Pop(false) if err != nil {