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
|
## Getting started
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
go get -u gitlab.com/naterciom/gubgub
|
go get github.com/naterciom/gubgub@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gitlab.com/naterciom/gubgub"
|
"github.com/naterciom/gubgub"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MyMessage struct {
|
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
|
// 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() {
|
func (t *AsyncTopic[T]) Close() {
|
||||||
t.mu.Lock()
|
t.mu.Lock()
|
||||||
if t.closing {
|
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.
|
// closed before returning.
|
||||||
t.mu.Unlock()
|
t.mu.Unlock()
|
||||||
<-t.closed
|
<-t.closed
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gitlab.com/naterciom/gubgub"
|
"github.com/nmoniz/gubgub"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user