From 4806e44b20d0cfeb6b8cd7640067603d4fb3e995 Mon Sep 17 00:00:00 2001 From: Hong Ooi Date: Wed, 27 May 2020 11:13:34 +1000 Subject: [PATCH] update docs --- DESCRIPTION | 1 - R/AzureQstor.R | 3 --- R/QueueMessage.R | 6 ++++++ R/StorageQueue.R | 13 ++++++++++++- R/endpoint.R | 2 ++ man/QueueMessage.Rd | 9 +++++++++ man/StorageQueue.Rd | 12 ++++++++++++ man/queue_endpoint.Rd | 3 +++ 8 files changed, 44 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 20052d6..9e24930 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,7 +16,6 @@ Imports: AzureRMR (>= 2.0.0), AzureStor (>= 3.0.0), openssl, - xml2, httr Suggests: testthat, diff --git a/R/AzureQstor.R b/R/AzureQstor.R index d7ada46..246329a 100644 --- a/R/AzureQstor.R +++ b/R/AzureQstor.R @@ -25,6 +25,3 @@ get_classic_metadata_headers <- getNamespace("AzureStor")$get_classic_metadata_h set_classic_metadata_headers <- getNamespace("AzureStor")$set_classic_metadata_headers - -# tag xml2 to satisfy R CMD check -xml2::as_xml_document diff --git a/R/QueueMessage.R b/R/QueueMessage.R index 166d538..7250d83 100644 --- a/R/QueueMessage.R +++ b/R/QueueMessage.R @@ -62,6 +62,8 @@ public=list( #' @description #' Deletes this message from the queue. + #' @return + #' NULL, invisibly. delete=function() { private$check_receipt() @@ -76,6 +78,8 @@ public=list( #' This operation can be used to continually extend the invisibility of a queue message. This functionality can be useful if you want a worker role to "lease" a message. For example, if a worker role calls [`get_messages`][StorageQueue] and recognizes that it needs more time to process a message, it can continually extend the message's invisibility until it is processed. If the worker role were to fail during processing, eventually the message would become visible again and another worker role could process it. #' @param visibility_timeout The new visibility timeout (time to when the message will again be visible). #' @param text Optionally, new message text, either a raw or character vector. If a raw vector, it is base64-encoded, and if a character vector, it is collapsed into a single string before being sent to the queue. + #' @return + #' The message object, invisibly. update=function(visibility_timeout, text=self$text) { private$check_receipt() @@ -101,6 +105,8 @@ public=list( #' @description #' Print method for this class. #' @param ... Not currently used. + #' @return + #' The message object, invisibly. print=function(...) { cat("\n", sep="") diff --git a/R/StorageQueue.R b/R/StorageQueue.R index 508f64f..ff7977a 100644 --- a/R/StorageQueue.R +++ b/R/StorageQueue.R @@ -73,6 +73,8 @@ public=list( #' @description #' Creates a storage queue in Azure, using the storage endpoint and name from this R6 object. + #' @return + #' The queue object, invisibly. create=function() { do_container_op(self, http_verb="PUT") @@ -82,6 +84,8 @@ public=list( #' @description #' Deletes this storage queue in Azure. #' @param confirm Whether to ask for confirmation before deleting. + #' @return + #' The queue object, invisibly. delete=function(confirm=TRUE) { if(!delete_confirmed(confirm, paste0(self$endpoint$url, name), "queue")) @@ -93,9 +97,12 @@ public=list( #' @description #' Clears (deletes) all messages in this storage queue. + #' @return + #' The queue object, invisibly. clear=function() { do_container_op(self, "messages", http_verb="DELETE") + invisible(self) }, #' @description @@ -121,7 +128,7 @@ public=list( else list(...) do_container_op(self, options=list(comp="metadata"), headers=set_classic_metadata_headers(meta), - http_verb = "PUT") + http_verb="PUT") invisible(meta) }, @@ -202,6 +209,8 @@ public=list( #' @param text The message text, either a raw or character vector. If a raw vector, it is base64-encoded, and if a character vector, it is collapsed into a single string before being sent to the queue. #' @param visibility_timeout Optional visibility timeout after being read, in seconds. The default is 30 seconds. #' @param time_to_live Optional message time-to-live, in seconds. The default is 7 days. + #' @return + #' The message text, invisibly. put_message=function(text, visibility_timeout=NULL, time_to_live=NULL) { text <- if(is.raw(text)) @@ -229,6 +238,8 @@ public=list( #' @param msg A message object, of class [`QueueMessage`]. #' @param visibility_timeout The new visibility timeout (time to when the message will again be visible). #' @param text Optionally, new message text, either a raw or character vector. If a raw vector, it is base64-encoded, and if a character vector, it is collapsed into a single string before being sent to the queue. + #' @return + #' The message object, invisibly. update_message=function(msg, visibility_timeout, text=msg$text) { stopifnot(inherits(msg, "QueueMessage")) diff --git a/R/endpoint.R b/R/endpoint.R index 2b03242..a429a4e 100644 --- a/R/endpoint.R +++ b/R/endpoint.R @@ -8,6 +8,8 @@ #' #' @details #' This is the queue storage counterpart to the endpoint functions defined in the AzureStor package. +#' @return +#' An object of class `queue_endpoint`, inheriting from `storage_endpoint`. #' @seealso #' [`AzureStor::storage_endpoint`], [`AzureStor::blob_endpoint`], [`storage_queue`] #' @examples diff --git a/man/QueueMessage.Rd b/man/QueueMessage.Rd index b245e9a..f1c8ec2 100644 --- a/man/QueueMessage.Rd +++ b/man/QueueMessage.Rd @@ -80,6 +80,9 @@ Deletes this message from the queue. \if{html}{\out{
}}\preformatted{QueueMessage$delete()}\if{html}{\out{
}} } +\subsection{Returns}{ +NULL, invisibly. +} } \if{html}{\out{
}} \if{html}{\out{}} @@ -101,6 +104,9 @@ This operation can be used to continually extend the invisibility of a queue mes } \if{html}{\out{}} } +\subsection{Returns}{ +The message object, invisibly. +} } \if{html}{\out{
}} \if{html}{\out{}} @@ -118,6 +124,9 @@ Print method for this class. } \if{html}{\out{}} } +\subsection{Returns}{ +The message object, invisibly. +} } \if{html}{\out{
}} \if{html}{\out{}} diff --git a/man/StorageQueue.Rd b/man/StorageQueue.Rd index f56f037..0900c94 100644 --- a/man/StorageQueue.Rd +++ b/man/StorageQueue.Rd @@ -114,6 +114,9 @@ Creates a storage queue in Azure, using the storage endpoint and name from this \if{html}{\out{
}}\preformatted{StorageQueue$create()}\if{html}{\out{
}} } +\subsection{Returns}{ +The queue object, invisibly. +} } \if{html}{\out{
}} \if{html}{\out{}} @@ -131,6 +134,9 @@ Deletes this storage queue in Azure. } \if{html}{\out{}} } +\subsection{Returns}{ +The queue object, invisibly. +} } \if{html}{\out{
}} \if{html}{\out{}} @@ -304,6 +310,9 @@ Writes a message to the back of the message queue. } \if{html}{\out{}} } +\subsection{Returns}{ +The message text, invisibly. +} } \if{html}{\out{
}} \if{html}{\out{}} @@ -327,6 +336,9 @@ This operation can be used to continually extend the invisibility of a queue mes } \if{html}{\out{}} } +\subsection{Returns}{ +The message object, invisibly. +} } \if{html}{\out{
}} \if{html}{\out{}} diff --git a/man/queue_endpoint.Rd b/man/queue_endpoint.Rd index 342d331..76c248e 100644 --- a/man/queue_endpoint.Rd +++ b/man/queue_endpoint.Rd @@ -23,6 +23,9 @@ queue_endpoint( \item{api_version}{The storage API version to use when interacting with the host. Defaults to \code{"2019-07-07"}.} } +\value{ +An object of class \code{queue_endpoint}, inheriting from \code{storage_endpoint}. +} \description{ Create a queue endpoint object }