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

Refactor Progress #834

Merged
merged 1 commit into from
Jul 24, 2019
Merged

Refactor Progress #834

merged 1 commit into from
Jul 24, 2019

Conversation

ermshiperete
Copy link
Member

@ermshiperete ermshiperete commented Jul 9, 2019

Follow-up of the big nuget PR (#786)

  • move Progress related classes in separate files
  • refactor ConsoleProgressTests to test what the name says
  • add comments to ProgressState classes that will eventually be deprecated

This change doesn't deprecate ProgressState yet because it is still used in too many libpalaso classes, and deprecating it would add a whole bunch of new warnings when compiling libpalaso. Instead I'd recommend to replace the usage of ProgressState over time.


This change is Reviewable

@ermshiperete
Copy link
Member Author

Not ready yet. Depends on #836.

@ermshiperete
Copy link
Member Author

This change adds a whole bunch of new warnings - everywhere where we use ProgressState in existing libpalaso code.

@ermshiperete ermshiperete changed the title Deprecate ProgressState Refactor Progress Jul 23, 2019
Copy link
Contributor

@papeh papeh left a comment

Choose a reason for hiding this comment

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

Reviewed 20 of 20 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ermshiperete)


SIL.Core/Progress/BackgroundWorkerState.cs, line 9 at r1 (raw file):

	/// Long-running tasks can be written to take one of these as an argument, and use it to notify others of their progress
	/// </summary>
	// Should be deprecated - [Obsolete]

is there a recommended replacement for BackgroundWorkerState?


SIL.Core.Tests/Data/RecordTokenTests.cs, line 238 at r1 (raw file):

			}

			public void Startup(IProgress state)

state is no longer the best name. How about progress.


SIL.Core.Tests/Progress/ConsoleProgressTests.cs, line 77 at r1 (raw file):

			{
				Thread.Sleep(1);
			}

minor: do you know why Thread.Sleep(2) couldn't replace this whole method? Why we even need to pretend to do work?

- move Progress related classes in separate files
- refactor ConsoleProgressTests to test what the name says
- add comments to ProgressState classes that will eventually be
  deprecated
@ermshiperete ermshiperete requested a review from papeh July 24, 2019 08:35
Copy link
Member Author

@ermshiperete ermshiperete left a comment

Choose a reason for hiding this comment

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

Reviewable status: 18 of 20 files reviewed, 3 unresolved discussions (waiting on @papeh)


SIL.Core/Progress/BackgroundWorkerState.cs, line 9 at r1 (raw file):

Previously, papeh wrote…

is there a recommended replacement for BackgroundWorkerState?

I'm not sure.


SIL.Core.Tests/Data/RecordTokenTests.cs, line 238 at r1 (raw file):

Previously, papeh wrote…

state is no longer the best name. How about progress.

Turns out this method isn't used at all.


SIL.Core.Tests/Progress/ConsoleProgressTests.cs, line 77 at r1 (raw file):

Previously, papeh wrote…

minor: do you know why Thread.Sleep(2) couldn't replace this whole method? Why we even need to pretend to do work?

I guess we'll find out 😄

Copy link
Contributor

@papeh papeh left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@papeh papeh merged commit 1985478 into sillsdev:feature/nuget Jul 24, 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