
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
github.com/olivere/taskqueue
This is just an experiment and not ready for production.
Taskqueue manages running and scheduling tasks (think Sidekiq or Resque).
Redis is currently only persistent storage backend. So you must have Redis installed.
Get the repository with go get github.com/olivere/taskqueue
.
Example:
// Create a Redis-based backend, namespaced with "taskqueue_example"
store := taskqueue.NewRedisStore("localhost:6379", "taskqueue_example", "", 0)
// Create a manager with the Redis store. See source for more options.
m := taskqueue.New(taskqueue.SetStore(store))
// Register one or more topics and their processor
m.Register("clicks", func(args ...interface{}) error {
// Handle "clicks" topic
})
// Start the manager
err := m.Start()
if err != nil {
panic(err)
}
// Enqueue a task: It'll be added to the input queue and processed eventually
err = m.Enqueue(&taskqueue.Task{Topic: "clicks", Args: []interface{}{640, 480}})
if err != nil {
panic(err)
}
...
// Stop the manager, either via Close (which stops immediately)
// or CloseWithTimeout (which gracefully waits until either all working
// tasks are completed or a timeout is reached)
err = m.CloseWithTimeout(15 * time.Second)
if err != nil {
panic(err)
}
See the tests for more details on using taskqueue.
Ensure the tests succeed with go test
. You may have to install dependencies.
Run an end-to-end test with go run e2e/main.go
. It simulates a real worker.
Play with the options: go run e2e/main.go -h
.
While running the end-to-end tests, open up a second console and run
cd ui && go run main.go
. Then direct your web browser to 127.0.0.1:12345
.
MIT License. See LICENSE file for details.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.