Documentation ¶
Index ¶
- Constants
- func CheckForPGNotifierEnvVars() bool
- func GetCurrentSQLTimestamp() string
- func GetPGNotifierConnectionString() string
- func Init()
- type ClaimResponseT
- type ClaimT
- type JobPayload
- type JobsResponse
- type MessagePayload
- type PgNotifierT
- func (notifier PgNotifierT) ClearJobs(ctx context.Context) (err error)
- func (notifier PgNotifierT) GetDBHandle() *sql.DB
- func (notifier *PgNotifierT) Publish(payload MessagePayload, schema *whUtils.SchemaT, priority int) (ch chan []ResponseT, err error)
- func (notifier *PgNotifierT) RunMaintenanceWorker(ctx context.Context) error
- func (notifier *PgNotifierT) Subscribe(ctx context.Context, workerId string, jobsBufferSize int) chan ClaimT
- func (notifier *PgNotifierT) UpdateClaimedEvent(claim *ClaimT, response *ClaimResponseT)
- type ResponseT
Constants ¶
View Source
const ( WaitingState = "waiting" ExecutingState = "executing" SucceededState = "succeeded" FailedState = "failed" AbortedState = "aborted" )
View Source
const ( AsyncJobType = "async_job" UploadJobType = "upload" )
View Source
const MaxTrackAsyncBatchRetries = 5
Variables ¶
This section is empty.
Functions ¶
func CheckForPGNotifierEnvVars ¶ added in v0.1.10
func CheckForPGNotifierEnvVars() bool
CheckForPGNotifierEnvVars Checks if all the required Env Variables for PG Notifier are present
func GetCurrentSQLTimestamp ¶
func GetCurrentSQLTimestamp() string
GetCurrentSQLTimestamp to get sql complaint current datetime string
func GetPGNotifierConnectionString ¶ added in v0.1.10
func GetPGNotifierConnectionString() string
GetPGNotifierConnectionString Returns PG Notifier DB Connection Configuration
Types ¶
type ClaimResponseT ¶
type ClaimResponseT struct { Payload json.RawMessage Err error }
type JobPayload ¶ added in v0.1.10
type JobPayload json.RawMessage
type JobsResponse ¶ added in v1.2.0
type MessagePayload ¶ added in v1.2.0
type MessagePayload struct { Jobs []JobPayload JobType string }
type PgNotifierT ¶
type PgNotifierT struct { URI string // contains filtered or unexported fields }
func New ¶
func New(workspaceIdentifier, fallbackConnectionInfo string) (notifier PgNotifierT, err error)
New Given default connection info return pg notifier object from it
func (PgNotifierT) ClearJobs ¶ added in v0.1.10
func (notifier PgNotifierT) ClearJobs(ctx context.Context) (err error)
func (PgNotifierT) GetDBHandle ¶ added in v0.1.10
func (notifier PgNotifierT) GetDBHandle() *sql.DB
func (*PgNotifierT) Publish ¶
func (notifier *PgNotifierT) Publish(payload MessagePayload, schema *whUtils.SchemaT, priority int) (ch chan []ResponseT, err error)
func (*PgNotifierT) RunMaintenanceWorker ¶ added in v0.1.10
func (notifier *PgNotifierT) RunMaintenanceWorker(ctx context.Context) error
RunMaintenanceWorker (blocking - to be called from go routine) re-triggers zombie jobs which were left behind by dead workers in executing state
func (*PgNotifierT) UpdateClaimedEvent ¶ added in v0.1.10
func (notifier *PgNotifierT) UpdateClaimedEvent(claim *ClaimT, response *ClaimResponseT)
Click to show internal directories.
Click to hide internal directories.