Skip to content

Commit

Permalink
Rename mode to 'publisher'.
Browse files Browse the repository at this point in the history
  • Loading branch information
TreyE committed Oct 16, 2023
1 parent 1286c15 commit c11aa03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/event_source/configure/mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def normal?
@value == :normal
end

def web?
@value == :web
def publisher?
@value == :publisher
end

def self.normal
Expand All @@ -26,7 +26,7 @@ def self.normal
def self.parse(mode_string)
return normal if mode_string.blank?
mode_sym = mode_string.to_sym
raise ::EventSource::Error::InvalidModeError, "\"#{mode_string}\" is an invalid mode. Must be empty, null, \"normal\", or \"web\"." if ![:web, :normal].include?(mode_sym)
raise ::EventSource::Error::InvalidModeError, "\"#{mode_string}\" is an invalid mode. Must be empty, null, \"normal\", or \"publisher\"." if ![:web, :publisher].include?(mode_sym)
self.new(mode_string.to_sym)
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/event_source/protocols/amqp/bunny_queue_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def subscribe(subscriber_klass, bindings)
@channel_proxy.subject.prefetch(prefetch)

# Do not spawn consumers in the 'webserver' mode
if ::EventSource.config.mode.web?
logger.debug "In web mode, not booting subscription"
if ::EventSource.config.mode.publisher?
logger.debug "In publisher mode, not booting subscription"
return
end

Expand Down

0 comments on commit c11aa03

Please sign in to comment.