Class NeonExtendedHelper
Implements extended helper methods.
Namespace: Neon.Common
Assembly: Neon.Common.Extensions.dll
Syntax
public static class NeonExtendedHelper
Methods
FromEnhancedCronExpression(string)
Converts an extended Quartz cron expression string into a standard Quartz expression. Currently, this supports the "R" character in any of the fields except for the year. This method will replace any "R" it finds with a random value for the fields it appears in.
This is useful for situations like uploading telemetry to a global service where you don't want a potentially large number of clients being scheduled to hit the service at the same time.
Declaration
public static string FromEnhancedCronExpression(string enhancedCronExpression)
Parameters
Type | Name | Description |
---|---|---|
string | enhancedCronExpression | Specifies the extended schdule string. |
Returns
Type | Description |
---|---|
string | The standard schedule string. |
Exceptions
Type | Condition |
---|---|
FormatException | Thrown for invalid cron expressions. |
SetUnixDomainSocketEveryonePermissions(string, bool, bool)
Modifies the everyone permissions for a unix domain socket. We use this for setting everyone permissions for unix domain sockets because it appears that these sockets only allow writes for the current or admin users by default when created by a gRPC server and perhaps in other situations.
Declaration
public static void SetUnixDomainSocketEveryonePermissions(string socketPath, bool read = false, bool write = false)
Parameters
Type | Name | Description |
---|---|---|
string | socketPath | Specifies the path the the unix domain socket. |
bool | read | Optionally grants read access. |
bool | write | Optionally grants write access. |