nats-pure 0.7.2 → 2.0.0.pre.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nats/client.rb +15 -0
- data/lib/nats/io/client.rb +1350 -1293
- data/lib/nats/io/errors.rb +62 -0
- data/lib/nats/io/js.rb +1090 -0
- data/lib/nats/io/msg.rb +56 -0
- data/lib/nats/io/parser.rb +7 -7
- data/lib/nats/io/subscription.rb +92 -0
- data/lib/nats/io/version.rb +7 -3
- data/lib/nats.rb +39 -0
- metadata +10 -4
@@ -0,0 +1,62 @@
|
|
1
|
+
# Copyright 2021 The NATS Authors
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
# you may not use this file except in compliance with the License.
|
4
|
+
# You may obtain a copy of the License at
|
5
|
+
#
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
#
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
# See the License for the specific language governing permissions and
|
12
|
+
# limitations under the License.
|
13
|
+
#
|
14
|
+
|
15
|
+
module NATS
|
16
|
+
module IO
|
17
|
+
class Error < StandardError; end
|
18
|
+
|
19
|
+
# When the NATS server sends us an 'ERR' message.
|
20
|
+
class ServerError < Error; end
|
21
|
+
|
22
|
+
# When we detect error on the client side.
|
23
|
+
class ClientError < Error; end
|
24
|
+
|
25
|
+
# When we cannot connect to the server (either initially or after a reconnect).
|
26
|
+
class ConnectError < Error; end
|
27
|
+
|
28
|
+
# When we cannot connect to the server because authorization failed.
|
29
|
+
class AuthError < ConnectError; end
|
30
|
+
|
31
|
+
# When we cannot connect serverince there are no servers available.
|
32
|
+
class NoServersError < ConnectError; end
|
33
|
+
|
34
|
+
# When there are no subscribers available to respond.
|
35
|
+
class NoRespondersError < ConnectError; end
|
36
|
+
|
37
|
+
# When the connection exhausts max number of pending pings replies.
|
38
|
+
class StaleConnectionError < Error; end
|
39
|
+
|
40
|
+
# When we do not get a result within a specified time.
|
41
|
+
class Timeout < Error; end
|
42
|
+
|
43
|
+
# When there is an i/o timeout with the socket.
|
44
|
+
class SocketTimeoutError < Timeout; end
|
45
|
+
|
46
|
+
# When we use an invalid subject.
|
47
|
+
class BadSubject < Error; end
|
48
|
+
|
49
|
+
# When an invalid subscription is used, like one already unsubscribed
|
50
|
+
# or when the NATS connection is already closed.
|
51
|
+
class BadSubscription < Error; end
|
52
|
+
|
53
|
+
# When a subscription hits the pending messages limit.
|
54
|
+
class SlowConsumer < Error; end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Timeout is raised when the client gives up waiting for a response from a service.
|
58
|
+
Timeout = ::NATS::IO::Timeout
|
59
|
+
|
60
|
+
# Error is any error thrown by the client library.
|
61
|
+
Error = ::NATS::IO::Error
|
62
|
+
end
|