C# Class RedisQueue.Net.Clients.QueueClient

Inheritance: IQueueClient
Mostrar archivo Open project: e-travel/RedisQueue.Net Class Usage Examples

Public Methods

Method Description
AllQueues ( ) : IList

Returns a list of all queues found.

AllTasks ( QueueName queue ) : IList

Returns all tasks.

AllTasks ( string queue ) : IList

Returns all tasks.

CriticalFail ( string reason ) : void

Marks the current task as failed, and regardless of the cycling setting, places it in the :failed queue.

Defer ( string reason ) : void

Marks the currently reserved task as Deferred.

Dispose ( ) : void

Disposable impl. Handles cleanup and marks any uncompleted tasks as failed.

Enqueue ( RedisQueue.Net.Clients.Entities.TaskMessage t ) : void

Adds a task to the queue specified in the task itself and sends a message to the associated channel, notifying any listeners.

Fail ( string reason ) : void

Marks the currently reserved task as failed.

FailedTasks ( QueueName queue ) : IList

Returns all failed tasks.

FailedTasks ( string queue ) : IList

Returns all failed tasks.

GetSubscription ( ) : IRedisSubscription

Returns an empty channel subscription.

PendingTasks ( QueueName queue ) : IList

Returns all pending tasks.

PendingTasks ( string queue ) : IList

Returns all pending tasks.

QueueClient ( ) : System

Uses app settings for RedisHost and RedisPort and local caching

QueueClient ( bool enableLocalCaching ) : System

Uses app settings for RedisHost and RedisPort

QueueClient ( string host, int port, bool enableCaching ) : System
RemoveTask ( RedisQueue.Net.Clients.Entities.TaskMessage task ) : void

Removes a task with a specific task identifier.

Reserve ( QueueName queue ) : RedisQueue.Net.Clients.Entities.TaskMessage

Obtains the first available task from the specified queue, and changes the client's state into TaskReserved. In that state, no new tasks can be reserved until the task's outcome is evident.

Reserve ( string queue ) : RedisQueue.Net.Clients.Entities.TaskMessage

Obtains the first available task from the specified queue, and changes the client's state into TaskReserved. In that state, no new tasks can be reserved until the task's outcome is evident.

SendMessage ( string message, QueueName queue ) : void

Sends a message to the channel associated with a specific queue.

SendMessage ( string message, string queue ) : void

Sends a message to the channel associated with a specific queue.

Succeed ( ) : void

Marks the currently reserved task as succeeded.

SucceededTasks ( QueueName queue ) : IList

Returns all succeeded tasks.

SucceededTasks ( string queue ) : IList

Returns all succeeded tasks.

Protected Methods

Method Description
CacheCurrentTask ( ) : void
CheckCacheAndRetrieveState ( ) : void
PurgeCache ( ) : void

Private Methods

Method Description
removeTask ( string queue, RedisQueue.Net.Clients.Entities.TaskMessage task ) : void

Method Details

AllQueues() public method

Returns a list of all queues found.
public AllQueues ( ) : IList
return IList

AllTasks() public method

Returns all tasks.
public AllTasks ( QueueName queue ) : IList
queue QueueName
return IList

AllTasks() public method

Returns all tasks.
public AllTasks ( string queue ) : IList
queue string
return IList

CacheCurrentTask() protected method

protected CacheCurrentTask ( ) : void
return void

CheckCacheAndRetrieveState() protected method

protected CheckCacheAndRetrieveState ( ) : void
return void

CriticalFail() public method

Marks the current task as failed, and regardless of the cycling setting, places it in the :failed queue.
public CriticalFail ( string reason ) : void
reason string
return void

Defer() public method

Marks the currently reserved task as Deferred.
No task has been reserved. Future failure not yet /// supported. CurrentTask is null. Something's seriously off.
public Defer ( string reason ) : void
reason string
return void

Dispose() public method

Disposable impl. Handles cleanup and marks any uncompleted tasks as failed.
public Dispose ( ) : void
return void

Enqueue() public method

Adds a task to the queue specified in the task itself and sends a message to the associated channel, notifying any listeners.
public Enqueue ( RedisQueue.Net.Clients.Entities.TaskMessage t ) : void
t RedisQueue.Net.Clients.Entities.TaskMessage
return void

Fail() public method

Marks the currently reserved task as failed.
No task has been reserved. Future failure not yet /// supported. CurrentTask is null. Something's seriously off.
public Fail ( string reason ) : void
reason string
return void

FailedTasks() public method

Returns all failed tasks.
public FailedTasks ( QueueName queue ) : IList
queue QueueName
return IList

FailedTasks() public method

Returns all failed tasks.
public FailedTasks ( string queue ) : IList
queue string
return IList

GetSubscription() public method

Returns an empty channel subscription.
public GetSubscription ( ) : IRedisSubscription
return IRedisSubscription

PendingTasks() public method

Returns all pending tasks.
public PendingTasks ( QueueName queue ) : IList
queue QueueName
return IList

PendingTasks() public method

Returns all pending tasks.
public PendingTasks ( string queue ) : IList
queue string
return IList

PurgeCache() protected method

protected PurgeCache ( ) : void
return void

QueueClient() public method

Uses app settings for RedisHost and RedisPort and local caching
public QueueClient ( ) : System
return System

QueueClient() public method

Uses app settings for RedisHost and RedisPort
public QueueClient ( bool enableLocalCaching ) : System
enableLocalCaching bool Enable/Disable local caching
return System

QueueClient() public method

public QueueClient ( string host, int port, bool enableCaching ) : System
host string
port int
enableCaching bool
return System

RemoveTask() public method

Removes a task with a specific task identifier.
public RemoveTask ( RedisQueue.Net.Clients.Entities.TaskMessage task ) : void
task RedisQueue.Net.Clients.Entities.TaskMessage
return void

Reserve() public method

Obtains the first available task from the specified queue, and changes the client's state into TaskReserved. In that state, no new tasks can be reserved until the task's outcome is evident.
public Reserve ( QueueName queue ) : RedisQueue.Net.Clients.Entities.TaskMessage
queue QueueName
return RedisQueue.Net.Clients.Entities.TaskMessage

Reserve() public method

Obtains the first available task from the specified queue, and changes the client's state into TaskReserved. In that state, no new tasks can be reserved until the task's outcome is evident.
public Reserve ( string queue ) : RedisQueue.Net.Clients.Entities.TaskMessage
queue string
return RedisQueue.Net.Clients.Entities.TaskMessage

SendMessage() public method

Sends a message to the channel associated with a specific queue.
public SendMessage ( string message, QueueName queue ) : void
message string
queue QueueName
return void

SendMessage() public method

Sends a message to the channel associated with a specific queue.
public SendMessage ( string message, string queue ) : void
message string
queue string
return void

Succeed() public method

Marks the currently reserved task as succeeded.
CurrentTask is null. Something's seriously off. No task has been reserved. Future success not yet /// supported.
public Succeed ( ) : void
return void

SucceededTasks() public method

Returns all succeeded tasks.
public SucceededTasks ( QueueName queue ) : IList
queue QueueName
return IList

SucceededTasks() public method

Returns all succeeded tasks.
public SucceededTasks ( string queue ) : IList
queue string
return IList