This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Netflix/conductor into dev
- Loading branch information
Showing
6 changed files
with
66 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
core/src/main/java/com/netflix/conductor/core/config/EventModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.netflix.conductor.core.config; | ||
|
||
import com.google.inject.AbstractModule; | ||
import com.google.inject.Singleton; | ||
import com.google.inject.multibindings.ProvidesIntoMap; | ||
import com.google.inject.multibindings.StringMapKey; | ||
import com.google.inject.name.Named; | ||
import com.netflix.conductor.core.events.ActionProcessor; | ||
import com.netflix.conductor.core.events.EventProcessor; | ||
import com.netflix.conductor.core.events.EventQueueProvider; | ||
import com.netflix.conductor.core.events.SimpleActionProcessor; | ||
import com.netflix.conductor.core.events.SimpleEventProcessor; | ||
import com.netflix.conductor.core.events.queue.EventPollSchedulerProvider; | ||
import com.netflix.conductor.core.events.queue.dyno.DynoEventQueueProvider; | ||
import com.netflix.conductor.dao.QueueDAO; | ||
import rx.Scheduler; | ||
|
||
import static com.netflix.conductor.core.events.EventQueues.EVENT_QUEUE_PROVIDERS_QUALIFIER; | ||
|
||
public class EventModule extends AbstractModule { | ||
|
||
public static final String CONDUCTOR_QUALIFIER = "conductor"; | ||
|
||
@Override | ||
protected void configure() { | ||
// start processing events when instance starts | ||
bind(ActionProcessor.class).to(SimpleActionProcessor.class); | ||
bind(EventProcessor.class).to(SimpleEventProcessor.class).asEagerSingleton(); | ||
bind(Scheduler.class).toProvider(EventPollSchedulerProvider.class).asEagerSingleton(); | ||
} | ||
|
||
@ProvidesIntoMap | ||
@StringMapKey(CONDUCTOR_QUALIFIER) | ||
@Singleton | ||
@Named(EVENT_QUEUE_PROVIDERS_QUALIFIER) | ||
public EventQueueProvider getDynoEventQueueProvider(QueueDAO queueDAO, Configuration configuration, Scheduler eventScheduler) { | ||
return new DynoEventQueueProvider(queueDAO, configuration, eventScheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters