Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/incremental producer #46

Merged
merged 18 commits into from
Aug 14, 2023

Conversation

andyborn
Copy link
Contributor

@andyborn andyborn commented Aug 1, 2023

First draft, a couple questions around meta mod times as TODOs. Ended up being more similar to the normal Producer than expected, so might be able to refactor in a follow up.

@andyborn andyborn requested a review from dim August 1, 2023 15:07
@andyborn andyborn self-assigned this Aug 1, 2023
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental_ext_test.go Outdated Show resolved Hide resolved
incremental_ext_test.go Outdated Show resolved Hide resolved
@andyborn andyborn force-pushed the feature/incremental-producer branch from b5192e0 to 73dddd7 Compare August 3, 2023 15:04
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
@andyborn andyborn requested a review from dim August 9, 2023 15:56
compression.go Outdated Show resolved Hide resolved
format.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental.go Show resolved Hide resolved
manifest.go Outdated Show resolved Hide resolved
manifest.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
producer.go Outdated Show resolved Hide resolved
producer.go Outdated Show resolved Hide resolved
producer.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
producer.go Outdated
type LastModFunc func(context.Context) (time.Time, error)

// ProducerState holds current state of producer.
type ProducerState struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K, I checked something and it works. There is no need to make ProducerState public.

  1. rename to producerState
  2. and embed as value not as pointer
type Producer struct {
  producerState
  // ...
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's what I have done to confirm:

// main.go
package main

import "x/internal"

func main() {
	x := new(internal.X)
	x.Inc()
	x.Inc()
	println(x.N()) // => 2
}
// internal/types.go

package internal

type X struct {
	y
}

type y struct {
	n int
}

func (y *y) Inc() {
	y.n++
}

func (y *y) N() int {
	return y.n
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, interesting.

incremental.go Outdated Show resolved Hide resolved
incremental.go Outdated Show resolved Hide resolved
@andyborn andyborn merged commit 32599d6 into bsm:main Aug 14, 2023
7 checks passed
@andyborn andyborn deleted the feature/incremental-producer branch August 14, 2023 09:47
@mxmCherry mxmCherry mentioned this pull request May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants