Subscription use channel of pointer of model, may cause thread-unsafe issue?
- Ngôn ngữ chính
- Go
- Star
- 10.8k
- Fork
- 1.3k
- Merge trung bình
- 2 ngày 36 phút
- Pull request đã merge (30 ngày)
- 26
Mô tả
### What happened?
The generated subscription, like
```go
func (r *subscriptionResolver) StatusUpdated(ctx context.Context, udid string) (<-chan *model.Status, error) {
...
}
```
using type of channel of <- chan *model.Status,
when passing pointer of model.Status to multiple goroutine, I think it may cause thread-unsafe problem.
### What did you expect?
`<-chan *model.Status` to `<- chan model.Status`
```go
func (r *subscriptionResolver) StatusUpdated(ctx context.Context, id string) (<-chan model.Status, error) {
...
}
```
### Minimal graphql.schema and models to reproduce
```
type Subscription {
statusUpdated(id: String!) : Status!
}
```
### versions
- `gqlgen version`?
v0.11.3-dev
- `go version`?
go version go1.14.3 linux/amd64
- dep or go modules?
go modules
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.