Skip to content

Conversation

@egilmorez
Copy link
Contributor

Adding ScheduleBuilder class to TOC and adding minimal commenting.

Happy to add additional comments for undocumented properties like retryConfig (or hide them if necessary); just LMK the right general verbiage.

Staged internally at: https://firebase.devsite.corp.google.com/docs/reference/functions/providers_pubsub_.schedulebuilder.

Thanks!

- title: 'TopicBuilder'
path: /docs/reference/functions/providers_pubsub_.topicbuilder.html
- title: 'ScheduleBuilder'
path: /docs/reference/functions/providers_pubsub_.schedulebuilder
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this missing a .html at the end? I notice all the other have it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch; it works, but there's no reason it should stand out.

}

/**
* The Google Cloud Pub/Sub schedule builder.
Copy link
Contributor

Choose a reason for hiding this comment

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

I hesitate to say Google Cloud Pub/Sub schedule builder. here, because that sounds to me like something that is built into pubsub. However, this is really just the Cloud Scheduler job that we create to run scheduled functions with.

Maybe this could be something like:

The schedule builder for scheduled functions. This describes the Cloud Scheduler job that will be deployed to trigger a scheduled function at the provided frequency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know . . . I think the reason this was overlooked was exactly that: we thought it was a class outside of CF3.

But here it is -- sourced from providers/pubsub.ts and generated along with the other files.

Joe do you think we should we actually be hiding/omitting this class from the reference docs instead of trying to add it and flesh it out?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should definitely be documenting it as a part of the firebase-functions reference docs. What about:

"The builder for scheduled functions, which are powered by Pub/Sub and Cloud Scheduler."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See what you think about this amalgam of all feedback. Snuck in a link to the guide.

Copy link
Contributor

Choose a reason for hiding this comment

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

This version SGTM!

}

/**
* Event handler that fires when a scheduled event occurs for
Copy link
Contributor

Choose a reason for hiding this comment

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

Language is a bit weird here - maybe something like "Event handler for scheduled functions. Triggered whenever the associated scheduler job sends a PubSub message"?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@laurenzlong laurenzlong left a comment

Choose a reason for hiding this comment

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

Describing scheduled functions is very tricky. Maybe we can try to be brief in the reference docs and link to https://firebase.google.com/docs/functions/schedule-functions whenever possible?

}

/**
* The Google Cloud Pub/Sub schedule builder.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should definitely be documenting it as a part of the firebase-functions reference docs. What about:

"The builder for scheduled functions, which are powered by Pub/Sub and Cloud Scheduler."

}

/**
* Event handler that fires when a scheduled event occurs for
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@egilmorez
Copy link
Contributor Author

Thanks for the feedback!

Again, feel free to suggest commenting for anything else in pubsub.ts that should be described in the reference docs.

/**
* Registers a Cloud Function to run at specified times.
*
* @param schedule The scheduling logic, in Unix Crontab or AppEngine syntax.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would go with the "The schedule" rather than "The scheduler logic", since it's not really a logic. It's just a definition of the schedule.

@egilmorez egilmorez merged commit 858cb9b into master Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants