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

dont need blockservice workers anymore #1622

Merged
merged 2 commits into from
Sep 16, 2015
Merged

dont need blockservice workers anymore #1622

merged 2 commits into from
Sep 16, 2015

Conversation

whyrusleeping
Copy link
Member

The worker in blockservice was useless. We buffer outgoing provides in bitswap anyways, removing the workers here will make things a bit simpler.

TODO:

  • delete workers code
  • figure out where context should come from

License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com

Sorry, something went wrong.

@jbenet jbenet added the status/in-progress In progress label Aug 28, 2015
@jbenet
Copy link
Member

jbenet commented Aug 29, 2015

Agree there's duplicated logic here, but I'm not sure this is right. Would like to see some benchmarks for this, when adding huge things in a networked environment.

an add operation should be completely decoupled from providing to the network. maybe should be using notifications/events for this:

add() -> emits "added <key>" notification

provider listens to "added <key>" notification

@whyrusleeping
Copy link
Member Author

@@ -67,7 +46,7 @@ func (s *BlockService) AddBlock(b *blocks.Block) (key.Key, error) {
if err != nil {
return k, err
}
if err := s.worker.HasBlock(b); err != nil {
if err := s.Exchange.HasBlock(context.TODO(), b); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

thinking that this HasBlock is a passive activity, not an active one like the "AddBlock" call. i.e. user is adding, not wanting to write out. or send blocks to others. may be worth doing .HasBlock in a goroutine/process/worker.

context should be derived from some context passed to the blockservice initially, not the current request, i think.

@whyrusleeping
Copy link
Member Author

@jbenet can has merge?

@jbenet
Copy link
Member

jbenet commented Sep 13, 2015

needs rebase. assign me when done

@whyrusleeping whyrusleeping force-pushed the feat/rm-worker branch 2 times, most recently from e49cb94 to 3d2f516 Compare September 14, 2015 18:16
@ghost ghost mentioned this pull request Sep 15, 2015
51 tasks
@jbenet
Copy link
Member

jbenet commented Sep 16, 2015

@whyrusleeping did it get out of date again?

@jbenet
Copy link
Member

jbenet commented Sep 16, 2015

sorry

@whyrusleeping
Copy link
Member Author

I can rebase again, this ones pretty easy compared to some of the others, lol

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
@whyrusleeping
Copy link
Member Author

@jbenet rebased.

jbenet added a commit that referenced this pull request Sep 16, 2015
dont need blockservice workers anymore
@jbenet jbenet merged commit c6166e5 into master Sep 16, 2015
@jbenet jbenet removed the status/in-progress In progress label Sep 16, 2015
@jbenet jbenet deleted the feat/rm-worker branch September 16, 2015 05:53
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.

None yet

2 participants