C# Class ShoutLib.Shouter

The worker class that converts lowercase to uppercase.
Mostra file Open project: GoogleCloudPlatform/pubsub-shout-csharp Class Usage Examples

Public Methods

Method Description
FromUnixTime ( long unixTime ) : System.DateTime

Converts a unix time (seconds since the epoch) to a DateTime.

Shout ( System cancellationToken ) : int

Waits for a shout request message to arrive in the Pub/Sub subscription. Converts the text to uppercase and posts the results back to the website.

Nothing more than a wrapper around ShoutOrThrow() to catch unexpected exceptions.

ShoutOrThrow ( System cancellationToken ) : int

Waits for a shout request message to arrive in the Pub/Sub subscription. Converts the text to uppercase and posts the results back to the website.

Shouter ( Initializer init = null ) : System
Shouter ( Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter logWriter ) : System

Private Methods

Method Description
Acknowledge ( string ackId ) : void

Removes a shout request message from the subscription.

MakeSubscriptionPath ( string subscription ) : string

Makes a full subscription path given a subscription name.

MakeTopicPath ( string topic ) : string

Makes a full topic path given a topic name.

PublishStatus ( string postStatusUrl, string postStatusToken, string status, string result = null ) : void

Posts a message back to the browser, via App Engine.

ShoutString ( string text, ThrowIfAborted throwIfAborted ) : string

Converts a string from lowercase to uppercase, taking an extra long time. During that time, it periodically calls testCancel so that the caller can abort the operation if it's taking too long.

WriteLog ( string message, TraceEventType severity = TraceEventType.Information ) : void

Writes a message to the log.

Method Details

FromUnixTime() public static method

Converts a unix time (seconds since the epoch) to a DateTime.
public static FromUnixTime ( long unixTime ) : System.DateTime
unixTime long Seconds since the epoch.
return System.DateTime

Shout() public method

Waits for a shout request message to arrive in the Pub/Sub subscription. Converts the text to uppercase and posts the results back to the website.
Nothing more than a wrapper around ShoutOrThrow() to catch unexpected exceptions.
public Shout ( System cancellationToken ) : int
cancellationToken System
return int

ShoutOrThrow() public method

Waits for a shout request message to arrive in the Pub/Sub subscription. Converts the text to uppercase and posts the results back to the website.
public ShoutOrThrow ( System cancellationToken ) : int
cancellationToken System
return int

Shouter() public method

public Shouter ( Initializer init = null ) : System
init Initializer
return System

Shouter() public method

public Shouter ( Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter logWriter ) : System
logWriter Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter
return System