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

[SR-2036] Naming of DispatchSource factory methods #736

Closed
swift-ci opened this issue Jul 8, 2016 · 1 comment
Closed

[SR-2036] Naming of DispatchSource factory methods #736

swift-ci opened this issue Jul 8, 2016 · 1 comment

Comments

@swift-ci
Copy link

swift-ci commented Jul 8, 2016

Previous ID SR-2036
Radar None
Original Reporter fumoboy007 (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug, SDKOverlay
Assignee None
Priority Medium

md5: 8436718ce74bfc22c5a82e791a10defc

Issue Description:

The API Design Guidelines mandate that factory methods begin with the prefix “make”.

Consider DispatchSource.read(fileDescriptor:queue:). Indeed, DispatchSource.read might mislead people to think that a read will be performed by this method. A clearer name would be DispatchSource.makeReadSource(fileDescriptor:queue:).

Ditto for the other factory methods.

Old Name New Name
.machSend(port:eventMask:queue:) .makeMachSendSource(port:eventMask:queue:)
.machReceive(port:queue:) .makeMachReceiveSource(port:queue:)
.memoryPressure(eventMask:queue:) .makeMemoryPressureSource(eventMask:queue:)
.process(identifier:eventMask:queue:) .makeProcessSource(identifier:eventMask:queue:)
.read(fileDescriptor:queue:) .makeReadSource(fileDescriptor:queue:)
.signal(signal:queue:) .makeSignalSource(signal:queue:)
.timer(flags:queue:) .makeTimerSource(flags:queue:)
.userDataAdd(queue:) .makeUserDataAddSource(queue:)
.userDataOr(queue:) .makeUserDataOrSource(queue:)
.fileSystemObject(fileDescriptor:eventMask:queue:) .makeFileSystemObjectSource(fileDescriptor:eventMask:queue:)
.write(fileDescriptor:queue:) .makeWriteSource(fileDescriptor:queue:)
@belkadan
Copy link

belkadan commented Jul 9, 2016

cc mww (JIRA User)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants