Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adds IEventExecutor.Schedule, proper cancellation of scheduled tasks#80

Merged
nayato merged 1 commit intoAzure:devfrom
nayato:cancel-schedule
Apr 6, 2016
Merged

Adds IEventExecutor.Schedule, proper cancellation of scheduled tasks#80
nayato merged 1 commit intoAzure:devfrom
nayato:cancel-schedule

Conversation

@nayato
Copy link
Member

@nayato nayato commented Apr 4, 2016

Motivation:
Allow for less GC when scheduling if Task-based API is not required. Allow for proper cleanup when canceling scheduled task so that associated resources can be cleaned up early.

Modifications:

  • Moved out scheduled task implementations from AbstractScheduledEventExecutor
  • Introduced IScheduledTask and aligned IScheduledRunnable
  • Implemented removal of scheduled task upon its cancellation

Result:
Scheduled tasks that normally never fire (e.g. timeout handling) do not cause resources to be held up unnecessarily in memory for longer period of time if not necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

return from here

@nayato nayato force-pushed the cancel-schedule branch 2 times, most recently from 085f4b9 to 6fb4ba4 Compare April 5, 2016 22:35
Copy link
Contributor

Choose a reason for hiding this comment

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

Please re-use this method above if possible

@mtuchkov
Copy link
Contributor

mtuchkov commented Apr 6, 2016

Looks good

@nayato nayato force-pushed the cancel-schedule branch from c7ff1d0 to 4b48c7b Compare April 6, 2016 02:11
Motivation:
Allow for less GC when scheduling if Task-based API is not required. Allow for proper cleanup when canceling scheduled task so that associated resources can be cleaned up early.

Modifications:
- Moved out scheduled task implementations from AbstractScheduledEventExecutor
- Introduced IScheduledTask and aligned IScheduledRunnable
- Implemented removal of scheduled task upon its cancellation
- Extra minor fixes
 - IByteBuffer.ToString(Encoding) honoring ArrayOffset
 - InternalLoggerFactory creating default logging factory lazily

Result:
Scheduled tasks that normally never fire (e.g. timeout handling) do not cause resources to be held up unnecessarily in memory for longer period of time if not necessary.
@nayato nayato force-pushed the cancel-schedule branch from 4b48c7b to d5a4c30 Compare April 6, 2016 02:18
@nayato nayato merged commit 1986553 into Azure:dev Apr 6, 2016
@nayato nayato deleted the cancel-schedule branch April 10, 2016 22:04
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