Skip to content

Commit 9e7f4b4

Browse files
author
Jacob Moody
authored
more docs (#25)
1 parent 96a3a37 commit 9e7f4b4

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

core.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,22 +398,28 @@ func (b *BTrDB) SnoopEpErr(ep *Endpoint, err chan error) chan error {
398398
return rv
399399
}
400400

401+
//Subscriptions represent a set of
402+
//real time subscriptions to streaming data.
401403
type Subscriptions struct {
402404
err chan error
403405
id []uuid.UUID
404406
c chan SubRecord
405407
}
406408

409+
//Data for a single stream returned from a Subscription.
407410
type SubRecord struct {
408411
ID uuid.UUID
409412
Val []RawPoint
410413
}
411414

415+
//An endpoint and its associated uuids.
412416
type EPGroup struct {
413417
*Endpoint
414418
ID []uuid.UUID
415419
}
416420

421+
//EndpointSplit takes a variadic list of uuids and organizes them by the endpoint
422+
//responsible for them.
417423
func (b *BTrDB) EndpointsSplit(ctx context.Context, id ...uuid.UUID) ([]EPGroup, error) {
418424
var err error
419425
var ep *Endpoint

driver.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,8 @@ func (b *Endpoint) Changes(ctx context.Context, uu uuid.UUID, fromVersion uint64
10231023
return rvc, rvv, rve
10241024
}
10251025

1026+
//SubscribeTo is a low level function that forks a goroutine in the background and fills the provided channls.
1027+
//It is assumed the caller has already ensured that this endpoint is responsible for the provided uuids.
10261028
func (b *Endpoint) SubscribeTo(ctx context.Context, uuid []uuid.UUID, c chan SubRecord, errc chan error) {
10271029
by := make([][]byte, len(uuid))
10281030
for i := range uuid {

0 commit comments

Comments
 (0)