Skip to content

Added GlobalRegionScheduler#getExecutor and RegionScheduler#getExecutor#32

Closed
jdkeke142 wants to merge 2 commits into
PaperMC:masterfrom
jdkeke142:master
Closed

Added GlobalRegionScheduler#getExecutor and RegionScheduler#getExecutor#32
jdkeke142 wants to merge 2 commits into
PaperMC:masterfrom
jdkeke142:master

Conversation

@jdkeke142
Copy link
Copy Markdown

@jdkeke142 jdkeke142 commented Apr 3, 2023

I added GlobalRegionScheduler#getExecutor and RegionScheduler#getExecutor to get respectively an executor of the global region and to get an executor of a corresponding region at a location. I find that these methods were useful in regular paper when working with CompletableFuture, I think other developers too. This PR aims to reintroduce them

@Machine-Maker
Copy link
Copy Markdown
Member

I think the method names should just be getExecutor(). They are on interfaces with the names Region and Global, it doesn't need to be repeated in the method name.

@jdkeke142 jdkeke142 changed the title Added GlobalRegionScheduler#getGlobalThreadExecutor and RegionScheduler#getRegionThreadExecutor Added GlobalRegionScheduler#getExecutor and RegionScheduler#getExecutor Apr 3, 2023
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Patch could use a shorter name.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It should be better now

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry, to clarify, you'll have to edit the commit summary for the patch files to retain shorter names - you can shove the longer description into the commit description.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry it's me not being familiar with the patch system. Does it look better now?

@kashike kashike added the type: feature Request for a new Feature. label Apr 3, 2023
Added GlobalRegionScheduler#getExecutor and RegionScheduler#getExecutor
to get respectively an executor of the global region
and to get an executor of a corresponding region
at a location
Added GlobalRegionScheduler#getExecutor and RegionScheduler#getExecutor
to get respectively an executor of the global region
and to get an executor of a corresponding region
at a location
Copy link
Copy Markdown

@Yomamaeatstoes Yomamaeatstoes left a comment

Choose a reason for hiding this comment

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

Looks good

@Spottedleaf
Copy link
Copy Markdown
Member

I don't want to encourage usage of CompletableFuture, since they do not follow reasonable error handling. I've learned this the hard way from Mojang's code, and I don't expect plugins to do a better job.

killerprojecte pushed a commit to killerprojecte/Folia that referenced this pull request Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Request for a new Feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants