Sha256: ad3561c5a824e9da67369b0dadfaa437d0253bb4ed9b6ab2d5829bb4cfca886f

Contents?: true

Size: 346 Bytes

Versions: 1

Compression:

Stored size: 346 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'jstreams'

STDOUT.sync = true
logger = Logger.new(STDOUT)

logger.info 'Starting publisher...'

jstreams = Jstreams::Context.new logger: logger

loop do
  body = "hello #{Time.now}"
  id = jstreams.publish('mystream', body)
  logger.info "published: #{id} - #{body}"
  sleep(1)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jstreams-0.1.0.alpha examples/basic/example_publisher.rb