moving everything to github
This commit is contained in:
@@ -6,7 +6,7 @@ I started to develop what is now GubGub in one of my personal projects but I soo
|
||||
## Getting started
|
||||
|
||||
```sh
|
||||
go get -u gitlab.com/naterciom/gubgub
|
||||
go get github.com/naterciom/gubgub@latest
|
||||
```
|
||||
|
||||
## Example
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"gitlab.com/naterciom/gubgub"
|
||||
"github.com/naterciom/gubgub"
|
||||
)
|
||||
|
||||
type MyMessage struct {
|
||||
|
||||
5
async.go
5
async.go
@@ -45,11 +45,12 @@ func NewAsyncTopic[T any](opts ...TopicOption) *AsyncTopic[T] {
|
||||
}
|
||||
|
||||
// Close terminates background go routines and prevents further publishing and subscribing. All
|
||||
// published messages are garanteed to be delivered once Close returns. This is idempotent.
|
||||
// published messages are garanteed to be delivered once Close returns. This is idempotent and
|
||||
// thread safe.
|
||||
func (t *AsyncTopic[T]) Close() {
|
||||
t.mu.Lock()
|
||||
if t.closing {
|
||||
// Multiple go routines attempted to close this topic. Both should wait for the topic to be
|
||||
// Multiple go routines attempted to close this topic. All should wait for the topic to be
|
||||
// closed before returning.
|
||||
t.mu.Unlock()
|
||||
<-t.closed
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitlab.com/naterciom/gubgub"
|
||||
"github.com/nmoniz/gubgub"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user