add package name to batch example
This commit is contained in:
Родитель
007bb69a6e
Коммит
3945c29014
14
readme.md
14
readme.md
|
@ -230,12 +230,16 @@ particular partition. You can do this in two ways.
|
||||||
#### Sending batches of events
|
#### Sending batches of events
|
||||||
Sending a batch of messages is more efficient than sending a single message. `SendBatch` takes an `*EventBatchIterator` that will automatically create batches from a slice of `*Event`.
|
Sending a batch of messages is more efficient than sending a single message. `SendBatch` takes an `*EventBatchIterator` that will automatically create batches from a slice of `*Event`.
|
||||||
```go
|
```go
|
||||||
var events []*Event
|
import (
|
||||||
events = append(events, NewEventFromString("one"))
|
eventhub "github.com/Azure/azure-event-hubs-go/v2"
|
||||||
events = append(events, NewEventFromString("two"))
|
)
|
||||||
events = append(events, NewEventFromString("three"))
|
...
|
||||||
|
var events []*eventhub.Event
|
||||||
|
events = append(events, eventhub.NewEventFromString("one"))
|
||||||
|
events = append(events, eventhub.NewEventFromString("two"))
|
||||||
|
events = append(events, eventhub.NewEventFromString("three"))
|
||||||
|
|
||||||
err := client.SendBatch(ctx, NewEventBatchIterator(events...))
|
err := client.SendBatch(ctx, eventhub.NewEventBatchIterator(events...))
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Receiving
|
#### Receiving
|
||||||
|
|
Загрузка…
Ссылка в новой задаче