worker_spi.naptime in worker_spi example - Mailing list pgsql-hackers

From Jeremy Finzel
Subject worker_spi.naptime in worker_spi example
Date
Msg-id CAMa1XUgWQAFm+UFdrystTR2J0A4YnM7WB2EzoeBeB2oiS0NBFA@mail.gmail.com
Whole thread Raw
Responses Re: worker_spi.naptime in worker_spi example  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
Hello!

I am trying to create a background worker where I can pass in via SQL interface the naptime.  I'm not sure how to do this.  In the worker_spi example, _PG_init creates a configuration using the static variable worker_spi_naptime, but then it appears to call in worker_spi_main in the WaitLatch function the same variable worker_spi_naptime without referencing the configuration created in _PG_init.  Am I missing something here?

I could see how to pass in an int for naptime via the SQL interface but I'm not sure what the function is of this configuration.

Thanks!
Jeremy

pgsql-hackers by date:

Previous
From: Ildar Musin
Date:
Subject: Re: using index or check in ALTER TABLE SET NOT NULL
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Removing [Merge]Append nodes which contain a single subpath