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

replace bounded channel with unbounded channel #18

Merged
merged 3 commits into from
Aug 10, 2024

Conversation

nkysg
Copy link
Contributor

@nkysg nkysg commented Aug 9, 2024

Motivation

Closes #14

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

src/backend.rs Outdated
Comment on lines 53 to 57
type AccountInfoSender = UnboundedSender<DatabaseResult<AccountInfo>>;
type StorageSender = UnboundedSender<DatabaseResult<U256>>;
type BlockHashSender = UnboundedSender<DatabaseResult<B256>>;
type FullBlockSender = UnboundedSender<DatabaseResult<Block>>;
type TransactionSender = UnboundedSender<DatabaseResult<WithOtherFields<Transaction>>>;
Copy link
Member

Choose a reason for hiding this comment

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

ah sorry, perhaps I wasn't clear enough on the issue, these oneshots are fine and we should keep using oneshot here,

the channel that we want to convert is this one

let (backend, backend_rx) = channel(1);

/// channel used for sending commands related to database operations
backend: Sender<BackendRequest>,

Copy link
Contributor Author

@nkysg nkysg Aug 10, 2024

Choose a reason for hiding this comment

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

It's my own fault. Your instruction is very clear. I need to dive into details. Thanks for your guiding. PTAL.

@nkysg nkysg requested a review from mattsse August 10, 2024 03:14
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

lgtm, pending @mattsse

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

nice

@mattsse mattsse merged commit a99e7b4 into foundry-rs:main Aug 10, 2024
16 checks passed
@nkysg nkysg deleted the unbound_channel branch August 10, 2024 09:58
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.

Replace bounded channel with unbounded channel
3 participants