Support multiple event publishing 57/457/4 v0.2.1
authorMarco Tallskog <marco.tallskog@nokia.com>
Wed, 3 Jul 2019 07:25:20 +0000 (10:25 +0300)
committerMarco Tallskog <marco.tallskog@nokia.com>
Wed, 3 Jul 2019 09:28:58 +0000 (12:28 +0300)
commitae7460ab662366115f6decc834a109bfa8985cc6
tree71dfc2a72013700187bcbf4afc68a00289482bf0
parent135580f96b31e8dd0ccd5695df877a7942b912ae
Support multiple event publishing

Support for publishing multiple events at once.
Originally it was possible to give multiple channels and
events as parameter to SetAndPublish() and RemoveAndPublish() API
functions. However, only the first event was published as
used Redis didn't support multiple event publishing. This
commit takes new Redis commands into use enabling the
support for multiple event publishing.

Add unit tests for internal sdlgoredis package. To be able
to stub external redisgo module, the Create() function is
splitted so that in unit tests it is possible to provide
a stub interface instead of the real one when building
the redisgo instance. Also Subscribe() function is wrapped,
and wrapper function is provided during setup as calling
the Subscribe() for the first time in code execution,
a new interface is provided that needs to be able to mock
in unit tests.

Improve documentation. Add doc.go which provides a better
documentation how to use SDL.

Change-Id: Id072d9397fa92ea37bcc78df7db54edadf4d9e7c
Signed-off-by: Marco Tallskog <marco.tallskog@nokia.com>
doc.go [new file with mode: 0644]
go.mod
go.sum
internal/sdlgoredis/sdlgoredis.go
internal/sdlgoredis/sdlgoredis_test.go [new file with mode: 0644]
sdl.go
sdl_test.go