Skip to content

[M2] Add deadlines to Transport.#32

Open
nkryuchkov wants to merge 27 commits intoskycoin:mainnet-milestone2from
nkryuchkov:feature/transport-deadline
Open

[M2] Add deadlines to Transport.#32
nkryuchkov wants to merge 27 commits intoskycoin:mainnet-milestone2from
nkryuchkov:feature/transport-deadline

Conversation

@nkryuchkov
Copy link
Copy Markdown
Collaborator

@nkryuchkov nkryuchkov commented Aug 14, 2019

Fixes #31

Changes:

  • Implemented SetReadDeadline
  • Implemented SetWriteDeadline
  • Implemented SetDeadline
  • Tests for the above implementations

@nkryuchkov nkryuchkov changed the title [WIP] Add deadlines to Transport Add deadlines to Transport Aug 15, 2019
@nkryuchkov nkryuchkov requested a review from evanlinjin August 15, 2019 21:30
Copy link
Copy Markdown

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

Looks mostly good. Just skimmed through it briefly.

Copy link
Copy Markdown

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

My recommendation is to have deadline implemented with all the following member functions:

  • Close()
  • SetDeadline(t time.Time)
  • Serve()
  • DeadlineExceeded() bool
  • DeadlineCh() <-chan struct

This can improve readability and testability.

@nkryuchkov nkryuchkov requested a review from evanlinjin August 17, 2019 17:41
Copy link
Copy Markdown

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

Please review my comments.
We probably also need a deadline_test.go for ensuring that it is completely thread-safe.

@nkryuchkov nkryuchkov requested a review from evanlinjin August 20, 2019 08:36
@evanlinjin evanlinjin changed the base branch from master to mainnet-milestone1 August 26, 2019 02:57
@evanlinjin
Copy link
Copy Markdown

@nkryuchkov Please resolve conflicts. Thank you!

…re/transport-deadline

# Conflicts:
#	server_test.go
#	transport.go
@nkryuchkov
Copy link
Copy Markdown
Collaborator Author

@evanlinjin done

@evanlinjin evanlinjin changed the base branch from mainnet-milestone1 to mainnet-milestone2 September 12, 2019 05:30
@evanlinjin evanlinjin changed the title Add deadlines to Transport [M2] Add deadlines to Transport, Sep 12, 2019
@evanlinjin evanlinjin changed the title [M2] Add deadlines to Transport, [M2] Add deadlines to Transport. Sep 12, 2019
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