Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Mar 14, 2024
1 parent 00e04b8 commit ba6ff97
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Sources/HummingbirdJobsPostgres/PostgresJobsQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ import NIOConcurrencyHelpers
import NIOCore
import PostgresNIO

/// Postgres Job queue implementation
///
/// The Postgres driver uses the database migration service ``/HummingbirdPostgres/PostgresMigrations``
/// to create its database tables. Before the server is running you should run the migrations
/// to build your table.
/// ```
/// let migrations = PostgresMigrations()
/// let jobqueue = await JobQueue(
/// PostgresQueue(
/// client: postgresClient,
/// migrations: postgresMigrations,
/// configuration: configuration,
/// logger: logger
/// ),
/// numWorkers: numWorkers,
/// logger: logger
/// )
/// var app = Application(...)
/// app.runBeforeServerStart {
/// try await migrations.apply(client: postgresClient, logger: logger, dryRun: applyMigrations)
/// }
/// ```
public final class PostgresQueue: JobQueueDriver {
public typealias JobID = UUID

Expand Down
12 changes: 12 additions & 0 deletions Sources/HummingbirdPostgres/PostgresPersistDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ extension PSQLError {
}

/// Postgres driver for persist system for storing persistent cross request key/value pairs
///
/// The Postgres driver uses the database migration service ``PostgresMigrations`` to
/// create its database table. Before the server is running you should run the migrations
/// to build your table.
/// ```
/// let migrations = PostgresMigrations()
/// let persist = PostgresPersistDriver(client: postgresClient, migrations: migrations)
/// var app = Application(...)
/// app.runBeforeServerStart {
/// try await migrations.apply(client: postgresClient, logger: logger, dryRun: applyMigrations)
/// }
/// ```
public final class PostgresPersistDriver: PersistDriver {
struct WrapperObject<Value: Codable>: PostgresCodable, Codable {
let value: Value
Expand Down

0 comments on commit ba6ff97

Please sign in to comment.