summaryrefslogtreecommitdiffstats
path: root/adapter/mock/mock_adapter.go
diff options
context:
space:
mode:
authorMilan Lenco <milan.lenco@pantheon.tech>2017-11-15 11:52:18 +0100
committerMilan Lenco <milan.lenco@pantheon.tech>2017-11-15 16:58:00 +0100
commitd86cd12b17106b6c0dfc7424ba4d11d5dbd8253e (patch)
tree10ea2eb5fcc0100536785fbedda804cbda347189 /adapter/mock/mock_adapter.go
parent3f1edad4e6ba0a7876750aea55507fae14d8badf (diff)
Mock Adapter: Switch back to handlers once the queue is empty.
Change-Id: Ifc85a80498521ef218a34072cce470bf32cead9c Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Diffstat (limited to 'adapter/mock/mock_adapter.go')
-rw-r--r--adapter/mock/mock_adapter.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/adapter/mock/mock_adapter.go b/adapter/mock/mock_adapter.go
index 8c88030..e6b4bc4 100644
--- a/adapter/mock/mock_adapter.go
+++ b/adapter/mock/mock_adapter.go
@@ -274,6 +274,11 @@ func (a *VppAdapter) SendMsg(clientID uint32, data []byte) error {
}
if len(replies) > 0 {
replies = []api.Message{}
+ if len(replyHandlers) > 0 {
+ // Switch back to handlers once the queue is empty to revert back
+ // the fallthrough effect.
+ mode = useReplyHandlers
+ }
return nil
}