Interface ICommandService
Service responsible for subscribing and unsubscribing to Meadow commands.
Assembly: Meadow.Contracts.dll
View Source
public interface ICommandService
Methods
Subscribe(Action<MeadowCommand>)
Subscribes an action to handle a generic Meadow command.
View Source
void Subscribe(Action<MeadowCommand> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<Meadow.Cloud.MeadowCommand> | action | The action to perform when any Meadow command is received. |
Subscribe<T>(Action<T>)
Subscribes an action to handle a Meadow command of type T.
View Source
void Subscribe<T>(Action<T> action) where T : IMeadowCommand, new()
Parameters
Type | Name | Description |
---|---|---|
System.Action<<T>> | action | The action to perform when a Meadow command with a command name that matches |
the name of type T is received. |
Type Parameters
Name | Description |
---|---|
T | Type of the meadow command. |
Unsubscribe<T>()
Unsubscribes an action that handles a Meadow command of type T.
View Source
void Unsubscribe<T>() where T : IMeadowCommand, new()
Type Parameters
Name | Description |
---|---|
T | Type of the meadow command. |
Unsubscribe()
Unsubscribes an action to handle a generic Meadow command.
View Source
void Unsubscribe()