Skip to content

Conversation

@JoshLove-msft
Copy link
Member

@JoshLove-msft JoshLove-msft commented Jun 16, 2020

  • Support schedule/cancel schedule multiple messages (Implement Schedule/CancelScheduled batch #9874)
  • Remove use of "batch" in Peek/Receive methods.
  • Add Message/Messages suffix to Peek/Send/Receive/Abandon/Defer/Complete/DeadLetter for consistency with Schedule/ReceiveDeferred
  • Rename CreateBatchOptions -> CreateMessageBatchOptions

@JoshLove-msft JoshLove-msft removed the request for review from erich-wang June 16, 2020 17:56
///
/// <returns>List of messages received. Returns an empty list if no message is found.</returns>
public override async Task<IList<ServiceBusReceivedMessage>> ReceiveBatchAsync(
public override async Task<IList<ServiceBusReceivedMessage>> ReceiveMessagesAsync(
Copy link
Member

Choose a reason for hiding this comment

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

I like this change; It feels more natural and reads better to me.

/// <param name="cancellationToken">An optional <see cref="CancellationToken"/> instance to signal the request to cancel the operation.</param>
///
/// <returns>The batch of <see cref="ServiceBusMessage" /> from the Service Bus entity this receiver is associated with. If no messages are present, an empty list is returned.</returns>
/// <returns>The list of <see cref="ServiceBusMessage" /> from the Service Bus entity this receiver is associated with. If no messages are present, an empty list is returned.</returns>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe consider "set" as a more neutral term? "List" makes me think concrete implementation, which isn't wrong here, given the IList return type, but the "list" form isn't really important in the context.

Copy link
Member Author

Choose a reason for hiding this comment

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

I went back and forth on this but since it returns an IList, list feels appropriate. "Set" might also mean a concrete implementation to some. Alternatively, I can just cref the whole IList but that felt unnecesary.

Copy link
Member

Choose a reason for hiding this comment

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

I'm good whichever way you feel is best.

Copy link
Member Author

@JoshLove-msft JoshLove-msft Jun 17, 2020

Choose a reason for hiding this comment

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

This might be something to look at in terms of consistency across the Track 2 libraries, as this surely isn't a new issue. Though HTTP libraries use AsyncPageable so the nomenclature would be different. I guess we should at least try to align across SB/EH.

/// </summary>
///
public class CreateBatchOptions
public class CreateMessageBatchOptions
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that this rename offers much. Were we concerned that there would be confusion with another set of batch creation options?

I wouldn't think that this type is something that developers would need to discover from a list on its own, but would instead be guided by the parameter type/name when explicitly calling to create a batch. At that point, I think the purpose is clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, we renamed the operation to CreateMessageBatchAsync, so this maintains consistency with that. Do you have the same concerns with renaming to CreateMessageBatchAsync?

Copy link
Member

Choose a reason for hiding this comment

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

I do. I'm bucketing them both under the question "does adding more words add more clarity or just give readers more things to parse?" That said, I don't have particularly strong feelings.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it adds more clarity and also consistency. We are now adding Message/Messages for all service operations that operate on a message. It would be strange to not do the same here.

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.

4 participants