firehose 1.3.6 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +31 -10
  3. data/{LICENSE.txt → LICENSE} +6 -6
  4. data/README.md +379 -187
  5. data/app/assets/javascripts/firehose.js +258 -0
  6. data/config/importmap.rb +1 -0
  7. data/db/migrate/20260214185244_create_firehose_events.rb +23 -0
  8. data/lib/commands/firehose_command.rb +119 -0
  9. data/lib/firehose/channel.rb +40 -0
  10. data/lib/firehose/cleanup_job.rb +21 -0
  11. data/lib/firehose/engine.rb +36 -0
  12. data/lib/firehose/helper.rb +40 -0
  13. data/lib/firehose/models/channel.rb +12 -0
  14. data/lib/firehose/models/message.rb +11 -0
  15. data/lib/firehose/queue.rb +44 -0
  16. data/lib/firehose/server.rb +930 -17
  17. data/lib/firehose/sse.rb +187 -0
  18. data/lib/firehose/stream.rb +32 -0
  19. data/lib/firehose/streamable.rb +25 -0
  20. data/lib/firehose/websocket.rb +242 -0
  21. data/lib/firehose.rb +67 -15
  22. data/lib/generators/firehose/install/install_generator.rb +43 -0
  23. data/lib/generators/firehose/install/templates/firehose_controller.rb +16 -0
  24. metadata +39 -366
  25. data/.codeclimate.yml +0 -29
  26. data/.dockerignore +0 -2
  27. data/.env.sample +0 -17
  28. data/.gitignore +0 -14
  29. data/.rspec +0 -1
  30. data/.rubocop.yml +0 -1156
  31. data/.ruby-version +0 -1
  32. data/.travis.yml +0 -12
  33. data/Dockerfile +0 -11
  34. data/Gemfile +0 -6
  35. data/Procfile +0 -1
  36. data/Procfile.dev +0 -3
  37. data/Rakefile +0 -64
  38. data/bin/firehose +0 -9
  39. data/coffeelint.json +0 -129
  40. data/config/rainbows.rb +0 -17
  41. data/docker-compose.yml +0 -17
  42. data/firehose.gemspec +0 -45
  43. data/karma.config.coffee +0 -89
  44. data/lib/assets/javascripts/firehose/base.js.coffee +0 -4
  45. data/lib/assets/javascripts/firehose/consumer.js.coffee +0 -86
  46. data/lib/assets/javascripts/firehose/core.js.coffee +0 -6
  47. data/lib/assets/javascripts/firehose/long_poll.js.coffee +0 -210
  48. data/lib/assets/javascripts/firehose/multiplexed_consumer.js.coffee +0 -74
  49. data/lib/assets/javascripts/firehose/transport.js.coffee +0 -44
  50. data/lib/assets/javascripts/firehose/version.js.coffee.erb +0 -2
  51. data/lib/assets/javascripts/firehose/web_socket.js.coffee +0 -148
  52. data/lib/assets/javascripts/firehose.js.coffee +0 -2
  53. data/lib/firehose/assets.rb +0 -56
  54. data/lib/firehose/cli.rb +0 -79
  55. data/lib/firehose/client/consumer.rb +0 -94
  56. data/lib/firehose/client/producer.rb +0 -114
  57. data/lib/firehose/client.rb +0 -10
  58. data/lib/firehose/logging.rb +0 -32
  59. data/lib/firehose/rack/app.rb +0 -49
  60. data/lib/firehose/rack/consumer/http_long_poll.rb +0 -159
  61. data/lib/firehose/rack/consumer/web_socket.rb +0 -200
  62. data/lib/firehose/rack/consumer.rb +0 -78
  63. data/lib/firehose/rack/ping.rb +0 -88
  64. data/lib/firehose/rack/publisher.rb +0 -59
  65. data/lib/firehose/rack.rb +0 -32
  66. data/lib/firehose/rails.rb +0 -7
  67. data/lib/firehose/server/app.rb +0 -52
  68. data/lib/firehose/server/channel.rb +0 -72
  69. data/lib/firehose/server/message_buffer.rb +0 -59
  70. data/lib/firehose/server/publisher.rb +0 -133
  71. data/lib/firehose/server/redis.rb +0 -32
  72. data/lib/firehose/server/subscriber.rb +0 -51
  73. data/lib/firehose/version.rb +0 -4
  74. data/package.json +0 -17
  75. data/spec/integrations/integration_test_helper.rb +0 -22
  76. data/spec/integrations/rainbows_spec.rb +0 -7
  77. data/spec/integrations/shared_examples.rb +0 -202
  78. data/spec/integrations/thin_spec.rb +0 -7
  79. data/spec/javascripts/firehose/base_spec.coffee +0 -2
  80. data/spec/javascripts/firehose/consumer_spec.coffee +0 -45
  81. data/spec/javascripts/firehose/long_poll_spec.coffee +0 -44
  82. data/spec/javascripts/firehose/multiplexed_consumer_spec.coffee +0 -72
  83. data/spec/javascripts/firehose/transport_spec.coffee +0 -30
  84. data/spec/javascripts/firehose/websocket_spec.coffee +0 -27
  85. data/spec/javascripts/helpers/spec_helper.js +0 -31
  86. data/spec/javascripts/support/jquery-1.11.1.js +0 -10308
  87. data/spec/javascripts/support/json2.js +0 -487
  88. data/spec/javascripts/support/sinon-1.7.3.js +0 -4290
  89. data/spec/javascripts/support/spec_helper.coffee +0 -3
  90. data/spec/lib/assets_spec.rb +0 -35
  91. data/spec/lib/client/consumer_spec.rb +0 -13
  92. data/spec/lib/client/producer_spec.rb +0 -71
  93. data/spec/lib/firehose_spec.rb +0 -7
  94. data/spec/lib/rack/consumer/http_long_poll_spec.rb +0 -30
  95. data/spec/lib/rack/consumer_spec.rb +0 -19
  96. data/spec/lib/rack/ping_spec.rb +0 -28
  97. data/spec/lib/rack/publisher_spec.rb +0 -34
  98. data/spec/lib/server/app_spec.rb +0 -15
  99. data/spec/lib/server/channel_spec.rb +0 -178
  100. data/spec/lib/server/message_buffer_spec.rb +0 -148
  101. data/spec/lib/server/publisher_spec.rb +0 -91
  102. data/spec/lib/server/redis_spec.rb +0 -13
  103. data/spec/lib/server/subscriber_spec.rb +0 -70
  104. data/spec/spec_helper.rb +0 -84
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c148dae251195e43b8fd4faca4cc9e7050f19eec
4
- data.tar.gz: 5267d1460b5688f3fb43a708a60e2b1810976f4b
2
+ SHA256:
3
+ metadata.gz: e7fb40526e73e5decd3cd2ae18fc3da69502ee6b1e8d38ea3e2d10361a10ef6f
4
+ data.tar.gz: 222baf458fef42ea37638466994ec51d5dc391b40b1ef0522458d945cb57c35e
5
5
  SHA512:
6
- metadata.gz: 544226dbb6b01f831307fb4768d87b2d9cc60b5ff5593e93b5f9dbdcb40d3ffde1465f726a59dff0f2014dbec24d5d6c01263355b9f5802680b3356fbb5614e9
7
- data.tar.gz: d6ec1f315d4ccdcafea10f6fb3186731195c1de37269748b26b4e68bb01905d4feb6975a84f8e1a4bafde7eb0520a341883583f1d5c9307e08fdeb93ff017cc2
6
+ metadata.gz: 82465cb22062fa8f771b9cb3a25e17e7c79fc89d66784fe63834f3a8cb629ab076e2090b0a01436e5736c4c096d1653e535cdfac9e58241c1121005e52befccc
7
+ data.tar.gz: 82ff21e6478fdb376bbc9faf784c50b3112541113ac045afdc7ad0c585f4bc126f4fd6ae24ca1aee70840d9fa02765b9ebf66183003343f100f6f5f3c2c04262
data/CHANGELOG.md CHANGED
@@ -1,15 +1,36 @@
1
- ## master
1
+ # Changelog
2
2
 
3
- - Configuration of Redis via the `Firehose::Server.redis` object.
4
- - Less rubygem dependencies: JSON gem removed because its included in Ruby 2.x
5
- - DEPRECATED: `firehose javascript` command will be removed. Those have been moved to https://github.com/firehoseio/js_client.
3
+ ## [2.1.0] - 2026-10-18
6
4
 
7
- ## 1.3.6
5
+ ### Fixed
8
6
 
9
- - DEPRECATION WARNING: `firehose javascript` has been removed from this project.
10
- - BUG: The null message bug fix in 1.3.5 introduce different behavior into the messages delivered when a client reconnects with a last_sequence. This has been corrected and 1.3.5 will be yanked.
7
+ - A NOTIFY sent on a pool connection the database had already closed is retried once on a fresh connection instead of dropped. Idle connections get closed server-side, and since `Firehose::Queue` messages aren't persisted, a dropped one was gone for good.
11
8
 
12
- ## 1.3.5
9
+ ## [2.0.0] - 2026
13
10
 
14
- - Fix bug where null messages are sent over WebSockets to client. Issue https://github.com/firehoseio/firehose/issues/51.
15
- - Drop support for Ruby 1.9.3. Documented official Ruby support policy in README.md
11
+ Complete rewrite with new architecture.
12
+
13
+ ### Added
14
+
15
+ - WebSocket transport via `Firehose::WebSocket`
16
+ - SSE transport via `Firehose::SSE`
17
+ - Combined transport via `Firehose::Stream`
18
+ - Database-backed message persistence with `Firehose::Channel` and `Firehose::Message`
19
+ - Automatic replay on reconnect via `last_event_id`
20
+ - Dedicated PG connection for LISTEN/NOTIFY (no ActionCable, no AR pool pressure)
21
+ - Inline NOTIFY delivery for small payloads, DB fallback for oversized (>8KB)
22
+ - Automatic PG reconnection with configurable exponential backoff
23
+ - `Firehose::Queue` for server-side push/pop over LISTEN/NOTIFY
24
+ - Per-channel monotonic sequences with counter cache
25
+ - Configurable cleanup threshold per stream
26
+ - Controller callbacks: `authorize_streams`, `build_event`
27
+ - Server-instance configuration via `configure`, `configure_from_yaml`, `configure_from_hash`
28
+ - Phlex helper for declarative stream elements
29
+ - Falcon/async-websocket compatibility
30
+
31
+ ### Changed
32
+
33
+ - Complete rewrite, not compatible with Firehose 1.x
34
+ - Messages stored in PostgreSQL instead of Redis
35
+ - Dedicated PG connection instead of ActionCable pubsub
36
+ - No channel abstractions, just streams and data
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) 2011-2013 Brad Gessler
3
+ Copyright (c) 2026 Brad Gessler
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
9
  copies of the Software, and to permit persons to whom the Software is
10
10
  furnished to do so, subject to the following conditions:
11
11
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
14
 
15
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.