Skip to content

RiverClient Init. Syntax Err #508

Closed
Closed

Description

@kashyap2108

I followd the documentation and wrote a sample code.

riverClient, err := river.NewClient(riverpgxv5.New(dbPool), &river.Config{
    Queues: map[string]river.QueueConfig{
        river.QueueDefault: {MaxWorkers: 100},
    },
    Workers: workers,
})

but this is showing syntax err.
and i had to change to below with passing a type.

riverClient, err := river.NewClient[pgx.Tx](riverpgxv5.New(dbPool), &river.Config{
		Queues: map[string]river.QueueConfig{
			river.QueueDefault: {MaxWorkers: 100},
		},
	})

Is there any version issue here ?

Activity

  1. ciokan commented on Aug 6, 2024

    @ciokan

    Same with the AddWorker code. I had to change the official example from river.AddWorker(workers, &SortWorker{}) to river.AddWorker[SortArgs](workers, &SortWorker{})

  2. locked and limited conversation to collaborators on Aug 6, 2024
  3. converted this issue into a discussion #509 on Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions