Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new JobsWorker class #30

Merged
merged 4 commits into from
Jun 21, 2019
Merged

add new JobsWorker class #30

merged 4 commits into from
Jun 21, 2019

Conversation

tanner0101
Copy link
Member

@tanner0101 tanner0101 commented Jun 21, 2019

A new class (internal for the time being) JobsWorker encapsulates the complex RepeatedTask logic. JobsCommand gets a simplified responsibility of creating and running n JobsWorkers. The JobsCommand is also responsible for shutting them down when requested from the command line.


The files have been re-arranged slightly for better organization.


Fixes #27

QueueService and QueueName were renamed to JobsService and JobsQueue respectively.


Fixes #29

I went a bit of a different route than described in the issue, but I think it's better. With this PR, you can configure Jobs with just a few lines of code:

s.provider(JobsProvider())
s.provider(RedisProvider())

s.register(JobsDriver.self) { c in
    return try JobsRedisDriver(client: c.make())
}
s.extend(JobsConfiguration.self) { config, c in
    config.add(FooJob())
}

Instead of relying on extensions to JobsConfiguration, this PR assumes that RedisProvider will expose RedisClient as a ready-to-use service.

This makes RedisClient the only dependency that JobsRedisDriver has on RedisKit.


Fixes #26

JobsConfiguration has had a few extra properties added to simplify configuration

@tanner0101 tanner0101 added bug Something isn't working enhancement New feature or request labels Jun 21, 2019
@tanner0101 tanner0101 merged commit bb41a64 into master Jun 21, 2019
@penny-coin
Copy link

Hey @tanner0101, you just merged a pull request, have a coin!

You now have 1298 coins.

@tanner0101 tanner0101 deleted the jobs-worker branch June 21, 2019 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
2 participants