bunny 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,135 @@
1
+ module Bunny
2
+ module Protocol
3
+ #:stopdoc:
4
+ class Class::Method
5
+ def initialize *args
6
+ opts = args.pop if args.last.is_a? Hash
7
+ opts ||= {}
8
+
9
+ @debug = 1 # XXX hack, p(obj) == '' if no instance vars are set
10
+
11
+ if args.size == 1 and args.first.is_a? Transport::Buffer
12
+ buf = args.shift
13
+ else
14
+ buf = nil
15
+ end
16
+
17
+ self.class.arguments.each do |type, name|
18
+ val = buf ? buf.read(type) :
19
+ args.shift || opts[name] || opts[name.to_s]
20
+ instance_variable_set("@#{name}", val)
21
+ end
22
+ end
23
+
24
+ def arguments
25
+ self.class.arguments.inject({}) do |hash, (type, name)|
26
+ hash.update name => instance_variable_get("@#{name}")
27
+ end
28
+ end
29
+
30
+ def to_binary
31
+ buf = Transport::Buffer.new
32
+ buf.write :short, self.class.parent.id
33
+ buf.write :short, self.class.id
34
+
35
+ bits = []
36
+
37
+ self.class.arguments.each do |type, name|
38
+ val = instance_variable_get("@#{name}")
39
+ if type == :bit
40
+ bits << (val || false)
41
+ else
42
+ unless bits.empty?
43
+ buf.write :bit, bits
44
+ bits = []
45
+ end
46
+ buf.write type, val
47
+ end
48
+ end
49
+
50
+ buf.write :bit, bits unless bits.empty?
51
+ buf.rewind
52
+
53
+ buf
54
+ end
55
+
56
+ def to_s
57
+ to_binary.to_s
58
+ end
59
+
60
+ def to_frame channel = 0
61
+ Transport::Frame::Method.new(self, channel)
62
+ end
63
+ end
64
+
65
+ class Header
66
+ def initialize *args
67
+ opts = args.pop if args.last.is_a? Hash
68
+ opts ||= {}
69
+
70
+ first = args.shift
71
+
72
+ if first.is_a? ::Class and first.ancestors.include? Protocol::Class
73
+ @klass = first
74
+ @size = args.shift || 0
75
+ @weight = args.shift || 0
76
+ @properties = opts
77
+
78
+ elsif first.is_a? Transport::Buffer or first.is_a? String
79
+ buf = first
80
+ buf = Transport::Buffer.new(buf) unless buf.is_a? Transport::Buffer
81
+
82
+ @klass = Protocol.classes[buf.read(:short)]
83
+ @weight = buf.read(:short)
84
+ @size = buf.read(:longlong)
85
+
86
+ props = buf.read(:properties, *klass.properties.map{|type,_| type })
87
+ @properties = Hash[*klass.properties.map{|_,name| name }.zip(props).reject{|k,v| v.nil? }.flatten]
88
+
89
+ else
90
+ raise ArgumentError, 'Invalid argument'
91
+ end
92
+
93
+ end
94
+ attr_accessor :klass, :size, :weight, :properties
95
+
96
+ def to_binary
97
+ buf = Transport::Buffer.new
98
+ buf.write :short, klass.id
99
+ buf.write :short, weight # XXX rabbitmq only supports weight == 0
100
+ buf.write :longlong, size
101
+ buf.write :properties, (klass.properties.map do |type, name|
102
+ [ type, properties[name] || properties[name.to_s] ]
103
+ end)
104
+ buf.rewind
105
+ buf
106
+ end
107
+
108
+ def to_s
109
+ to_binary.to_s
110
+ end
111
+
112
+ def to_frame channel = 0
113
+ Transport::Frame::Header.new(self, channel)
114
+ end
115
+
116
+ def == header
117
+ [ :klass, :size, :weight, :properties ].inject(true) do |eql, field|
118
+ eql and __send__(field) == header.__send__(field)
119
+ end
120
+ end
121
+
122
+ def method_missing meth, *args, &blk
123
+ @properties.has_key?(meth) || @klass.properties.find{|_,name| name == meth } ? @properties[meth] :
124
+ super
125
+ end
126
+ end
127
+
128
+ def self.parse buf
129
+ buf = Transport::Buffer.new(buf) unless buf.is_a? Transport::Buffer
130
+ class_id, method_id = buf.read(:short, :short)
131
+ classes[class_id].methods[method_id].new(buf)
132
+ end
133
+
134
+ end
135
+ end
@@ -0,0 +1,836 @@
1
+
2
+ #:stopdoc:
3
+ # this file was autogenerated on Fri May 08 08:23:09 +0100 2009
4
+ # using amqp-0.8.json (mtime: Fri May 08 02:14:44 +0100 2009)
5
+ #
6
+ # DO NOT EDIT! (edit ext/codegen.rb instead, and run `rake codegen`)
7
+
8
+ module Bunny
9
+ module Transport
10
+ class Frame
11
+ def self.types
12
+ @types ||= {}
13
+ end
14
+
15
+ def self.Frame id
16
+ (@_base_frames ||= {})[id] ||= Class.new(Frame) do
17
+ class_eval %[
18
+ def self.inherited klass
19
+ klass.const_set(:ID, #{id})
20
+ Frame.types[#{id}] = klass
21
+ end
22
+ ]
23
+ end
24
+ end
25
+
26
+ class Method < Frame( 1 ); end
27
+ class Header < Frame( 2 ); end
28
+ class Body < Frame( 3 ); end
29
+ class OobMethod < Frame( 4 ); end
30
+ class OobHeader < Frame( 5 ); end
31
+ class OobBody < Frame( 6 ); end
32
+ class Trace < Frame( 7 ); end
33
+ class Heartbeat < Frame( 8 ); end
34
+
35
+ FOOTER = 206
36
+ end
37
+ end
38
+ end
39
+
40
+ module Bunny
41
+ module Protocol
42
+ HEADER = "AMQP".freeze
43
+ VERSION_MAJOR = 8
44
+ VERSION_MINOR = 0
45
+ PORT = 5672
46
+
47
+ RESPONSES = {
48
+ 200 => :REPLY_SUCCESS,
49
+ 310 => :NOT_DELIVERED,
50
+ 311 => :CONTENT_TOO_LARGE,
51
+ 312 => :NO_ROUTE,
52
+ 313 => :NO_CONSUMERS,
53
+ 403 => :ACCESS_REFUSED,
54
+ 404 => :NOT_FOUND,
55
+ 405 => :RESOURCE_LOCKED,
56
+ 406 => :PRECONDITION_FAILED,
57
+ 320 => :CONNECTION_FORCED,
58
+ 402 => :INVALID_PATH,
59
+ }
60
+
61
+ FIELDS = [
62
+ :bit,
63
+ :long,
64
+ :longlong,
65
+ :longstr,
66
+ :octet,
67
+ :short,
68
+ :shortstr,
69
+ :table,
70
+ :timestamp,
71
+ ]
72
+
73
+ class Class
74
+ class << self
75
+ FIELDS.each do |f|
76
+ class_eval %[
77
+ def #{f} name
78
+ properties << [ :#{f}, name ] unless properties.include?([:#{f}, name])
79
+ attr_accessor name
80
+ end
81
+ ]
82
+ end
83
+
84
+ def properties() @properties ||= [] end
85
+
86
+ def id() self::ID end
87
+ def name() self::NAME end
88
+ end
89
+
90
+ class Method
91
+ class << self
92
+ FIELDS.each do |f|
93
+ class_eval %[
94
+ def #{f} name
95
+ arguments << [ :#{f}, name ] unless arguments.include?([:#{f}, name])
96
+ attr_accessor name
97
+ end
98
+ ]
99
+ end
100
+
101
+ def arguments() @arguments ||= [] end
102
+
103
+ def parent() Protocol.const_get(self.to_s[/Protocol::(.+?)::/,1]) end
104
+ def id() self::ID end
105
+ def name() self::NAME end
106
+ end
107
+
108
+ def == b
109
+ self.class.arguments.inject(true) do |eql, (type, name)|
110
+ eql and __send__("#{name}") == b.__send__("#{name}")
111
+ end
112
+ end
113
+ end
114
+
115
+ def self.methods() @methods ||= {} end
116
+
117
+ def self.Method(id, name)
118
+ @_base_methods ||= {}
119
+ @_base_methods[id] ||= ::Class.new(Method) do
120
+ class_eval %[
121
+ def self.inherited klass
122
+ klass.const_set(:ID, #{id})
123
+ klass.const_set(:NAME, :#{name.to_s})
124
+ klass.parent.methods[#{id}] = klass
125
+ klass.parent.methods[klass::NAME] = klass
126
+ end
127
+ ]
128
+ end
129
+ end
130
+ end
131
+
132
+ def self.classes() @classes ||= {} end
133
+
134
+ def self.Class(id, name)
135
+ @_base_classes ||= {}
136
+ @_base_classes[id] ||= ::Class.new(Class) do
137
+ class_eval %[
138
+ def self.inherited klass
139
+ klass.const_set(:ID, #{id})
140
+ klass.const_set(:NAME, :#{name.to_s})
141
+ Protocol.classes[#{id}] = klass
142
+ Protocol.classes[klass::NAME] = klass
143
+ end
144
+ ]
145
+ end
146
+ end
147
+ end
148
+ end
149
+
150
+ module Bunny
151
+ module Protocol
152
+ class Connection < Class( 10, :connection ); end
153
+ class Channel < Class( 20, :channel ); end
154
+ class Access < Class( 30, :access ); end
155
+ class Exchange < Class( 40, :exchange ); end
156
+ class Queue < Class( 50, :queue ); end
157
+ class Basic < Class( 60, :basic ); end
158
+ class File < Class( 70, :file ); end
159
+ class Stream < Class( 80, :stream ); end
160
+ class Tx < Class( 90, :tx ); end
161
+ class Dtx < Class( 100, :dtx ); end
162
+ class Tunnel < Class( 110, :tunnel ); end
163
+ class Test < Class( 120, :test ); end
164
+
165
+ class Connection
166
+
167
+ class Start < Method( 10, :start ); end
168
+ class StartOk < Method( 11, :start_ok ); end
169
+ class Secure < Method( 20, :secure ); end
170
+ class SecureOk < Method( 21, :secure_ok ); end
171
+ class Tune < Method( 30, :tune ); end
172
+ class TuneOk < Method( 31, :tune_ok ); end
173
+ class Open < Method( 40, :open ); end
174
+ class OpenOk < Method( 41, :open_ok ); end
175
+ class Redirect < Method( 50, :redirect ); end
176
+ class Close < Method( 60, :close ); end
177
+ class CloseOk < Method( 61, :close_ok ); end
178
+
179
+ class Start
180
+ octet :version_major
181
+ octet :version_minor
182
+ table :server_properties
183
+ longstr :mechanisms
184
+ longstr :locales
185
+ end
186
+
187
+ class StartOk
188
+ table :client_properties
189
+ shortstr :mechanism
190
+ longstr :response
191
+ shortstr :locale
192
+ end
193
+
194
+ class Secure
195
+ longstr :challenge
196
+ end
197
+
198
+ class SecureOk
199
+ longstr :response
200
+ end
201
+
202
+ class Tune
203
+ short :channel_max
204
+ long :frame_max
205
+ short :heartbeat
206
+ end
207
+
208
+ class TuneOk
209
+ short :channel_max
210
+ long :frame_max
211
+ short :heartbeat
212
+ end
213
+
214
+ class Open
215
+ shortstr :virtual_host
216
+ shortstr :capabilities
217
+ bit :insist
218
+ end
219
+
220
+ class OpenOk
221
+ shortstr :known_hosts
222
+ end
223
+
224
+ class Redirect
225
+ shortstr :host
226
+ shortstr :known_hosts
227
+ end
228
+
229
+ class Close
230
+ short :reply_code
231
+ shortstr :reply_text
232
+ short :class_id
233
+ short :method_id
234
+ end
235
+
236
+ class CloseOk
237
+ end
238
+
239
+ end
240
+
241
+ class Channel
242
+
243
+ class Open < Method( 10, :open ); end
244
+ class OpenOk < Method( 11, :open_ok ); end
245
+ class Flow < Method( 20, :flow ); end
246
+ class FlowOk < Method( 21, :flow_ok ); end
247
+ class Alert < Method( 30, :alert ); end
248
+ class Close < Method( 40, :close ); end
249
+ class CloseOk < Method( 41, :close_ok ); end
250
+
251
+ class Open
252
+ shortstr :out_of_band
253
+ end
254
+
255
+ class OpenOk
256
+ end
257
+
258
+ class Flow
259
+ bit :active
260
+ end
261
+
262
+ class FlowOk
263
+ bit :active
264
+ end
265
+
266
+ class Alert
267
+ short :reply_code
268
+ shortstr :reply_text
269
+ table :details
270
+ end
271
+
272
+ class Close
273
+ short :reply_code
274
+ shortstr :reply_text
275
+ short :class_id
276
+ short :method_id
277
+ end
278
+
279
+ class CloseOk
280
+ end
281
+
282
+ end
283
+
284
+ class Access
285
+
286
+ class Request < Method( 10, :request ); end
287
+ class RequestOk < Method( 11, :request_ok ); end
288
+
289
+ class Request
290
+ shortstr :realm
291
+ bit :exclusive
292
+ bit :passive
293
+ bit :active
294
+ bit :write
295
+ bit :read
296
+ end
297
+
298
+ class RequestOk
299
+ short :ticket
300
+ end
301
+
302
+ end
303
+
304
+ class Exchange
305
+
306
+ class Declare < Method( 10, :declare ); end
307
+ class DeclareOk < Method( 11, :declare_ok ); end
308
+ class Delete < Method( 20, :delete ); end
309
+ class DeleteOk < Method( 21, :delete_ok ); end
310
+
311
+ class Declare
312
+ short :ticket
313
+ shortstr :exchange
314
+ shortstr :type
315
+ bit :passive
316
+ bit :durable
317
+ bit :auto_delete
318
+ bit :internal
319
+ bit :nowait
320
+ table :arguments
321
+ end
322
+
323
+ class DeclareOk
324
+ end
325
+
326
+ class Delete
327
+ short :ticket
328
+ shortstr :exchange
329
+ bit :if_unused
330
+ bit :nowait
331
+ end
332
+
333
+ class DeleteOk
334
+ end
335
+
336
+ end
337
+
338
+ class Queue
339
+
340
+ class Declare < Method( 10, :declare ); end
341
+ class DeclareOk < Method( 11, :declare_ok ); end
342
+ class Bind < Method( 20, :bind ); end
343
+ class BindOk < Method( 21, :bind_ok ); end
344
+ class Purge < Method( 30, :purge ); end
345
+ class PurgeOk < Method( 31, :purge_ok ); end
346
+ class Delete < Method( 40, :delete ); end
347
+ class DeleteOk < Method( 41, :delete_ok ); end
348
+ class Unbind < Method( 50, :unbind ); end
349
+ class UnbindOk < Method( 51, :unbind_ok ); end
350
+
351
+ class Declare
352
+ short :ticket
353
+ shortstr :queue
354
+ bit :passive
355
+ bit :durable
356
+ bit :exclusive
357
+ bit :auto_delete
358
+ bit :nowait
359
+ table :arguments
360
+ end
361
+
362
+ class DeclareOk
363
+ shortstr :queue
364
+ long :message_count
365
+ long :consumer_count
366
+ end
367
+
368
+ class Bind
369
+ short :ticket
370
+ shortstr :queue
371
+ shortstr :exchange
372
+ shortstr :routing_key
373
+ bit :nowait
374
+ table :arguments
375
+ end
376
+
377
+ class BindOk
378
+ end
379
+
380
+ class Purge
381
+ short :ticket
382
+ shortstr :queue
383
+ bit :nowait
384
+ end
385
+
386
+ class PurgeOk
387
+ long :message_count
388
+ end
389
+
390
+ class Delete
391
+ short :ticket
392
+ shortstr :queue
393
+ bit :if_unused
394
+ bit :if_empty
395
+ bit :nowait
396
+ end
397
+
398
+ class DeleteOk
399
+ long :message_count
400
+ end
401
+
402
+ class Unbind
403
+ short :ticket
404
+ shortstr :queue
405
+ shortstr :exchange
406
+ shortstr :routing_key
407
+ table :arguments
408
+ end
409
+
410
+ class UnbindOk
411
+ end
412
+
413
+ end
414
+
415
+ class Basic
416
+ shortstr :content_type
417
+ shortstr :content_encoding
418
+ table :headers
419
+ octet :delivery_mode
420
+ octet :priority
421
+ shortstr :correlation_id
422
+ shortstr :reply_to
423
+ shortstr :expiration
424
+ shortstr :message_id
425
+ timestamp :timestamp
426
+ shortstr :type
427
+ shortstr :user_id
428
+ shortstr :app_id
429
+ shortstr :cluster_id
430
+
431
+ class Qos < Method( 10, :qos ); end
432
+ class QosOk < Method( 11, :qos_ok ); end
433
+ class Consume < Method( 20, :consume ); end
434
+ class ConsumeOk < Method( 21, :consume_ok ); end
435
+ class Cancel < Method( 30, :cancel ); end
436
+ class CancelOk < Method( 31, :cancel_ok ); end
437
+ class Publish < Method( 40, :publish ); end
438
+ class Return < Method( 50, :return ); end
439
+ class Deliver < Method( 60, :deliver ); end
440
+ class Get < Method( 70, :get ); end
441
+ class GetOk < Method( 71, :get_ok ); end
442
+ class GetEmpty < Method( 72, :get_empty ); end
443
+ class Ack < Method( 80, :ack ); end
444
+ class Reject < Method( 90, :reject ); end
445
+ class Recover < Method( 100, :recover ); end
446
+
447
+ class Qos
448
+ long :prefetch_size
449
+ short :prefetch_count
450
+ bit :global
451
+ end
452
+
453
+ class QosOk
454
+ end
455
+
456
+ class Consume
457
+ short :ticket
458
+ shortstr :queue
459
+ shortstr :consumer_tag
460
+ bit :no_local
461
+ bit :no_ack
462
+ bit :exclusive
463
+ bit :nowait
464
+ end
465
+
466
+ class ConsumeOk
467
+ shortstr :consumer_tag
468
+ end
469
+
470
+ class Cancel
471
+ shortstr :consumer_tag
472
+ bit :nowait
473
+ end
474
+
475
+ class CancelOk
476
+ shortstr :consumer_tag
477
+ end
478
+
479
+ class Publish
480
+ short :ticket
481
+ shortstr :exchange
482
+ shortstr :routing_key
483
+ bit :mandatory
484
+ bit :immediate
485
+ end
486
+
487
+ class Return
488
+ short :reply_code
489
+ shortstr :reply_text
490
+ shortstr :exchange
491
+ shortstr :routing_key
492
+ end
493
+
494
+ class Deliver
495
+ shortstr :consumer_tag
496
+ longlong :delivery_tag
497
+ bit :redelivered
498
+ shortstr :exchange
499
+ shortstr :routing_key
500
+ end
501
+
502
+ class Get
503
+ short :ticket
504
+ shortstr :queue
505
+ bit :no_ack
506
+ end
507
+
508
+ class GetOk
509
+ longlong :delivery_tag
510
+ bit :redelivered
511
+ shortstr :exchange
512
+ shortstr :routing_key
513
+ long :message_count
514
+ end
515
+
516
+ class GetEmpty
517
+ shortstr :cluster_id
518
+ end
519
+
520
+ class Ack
521
+ longlong :delivery_tag
522
+ bit :multiple
523
+ end
524
+
525
+ class Reject
526
+ longlong :delivery_tag
527
+ bit :requeue
528
+ end
529
+
530
+ class Recover
531
+ bit :requeue
532
+ end
533
+
534
+ end
535
+
536
+ class File
537
+ shortstr :content_type
538
+ shortstr :content_encoding
539
+ table :headers
540
+ octet :priority
541
+ shortstr :reply_to
542
+ shortstr :message_id
543
+ shortstr :filename
544
+ timestamp :timestamp
545
+ shortstr :cluster_id
546
+
547
+ class Qos < Method( 10, :qos ); end
548
+ class QosOk < Method( 11, :qos_ok ); end
549
+ class Consume < Method( 20, :consume ); end
550
+ class ConsumeOk < Method( 21, :consume_ok ); end
551
+ class Cancel < Method( 30, :cancel ); end
552
+ class CancelOk < Method( 31, :cancel_ok ); end
553
+ class Open < Method( 40, :open ); end
554
+ class OpenOk < Method( 41, :open_ok ); end
555
+ class Stage < Method( 50, :stage ); end
556
+ class Publish < Method( 60, :publish ); end
557
+ class Return < Method( 70, :return ); end
558
+ class Deliver < Method( 80, :deliver ); end
559
+ class Ack < Method( 90, :ack ); end
560
+ class Reject < Method( 100, :reject ); end
561
+
562
+ class Qos
563
+ long :prefetch_size
564
+ short :prefetch_count
565
+ bit :global
566
+ end
567
+
568
+ class QosOk
569
+ end
570
+
571
+ class Consume
572
+ short :ticket
573
+ shortstr :queue
574
+ shortstr :consumer_tag
575
+ bit :no_local
576
+ bit :no_ack
577
+ bit :exclusive
578
+ bit :nowait
579
+ end
580
+
581
+ class ConsumeOk
582
+ shortstr :consumer_tag
583
+ end
584
+
585
+ class Cancel
586
+ shortstr :consumer_tag
587
+ bit :nowait
588
+ end
589
+
590
+ class CancelOk
591
+ shortstr :consumer_tag
592
+ end
593
+
594
+ class Open
595
+ shortstr :identifier
596
+ longlong :content_size
597
+ end
598
+
599
+ class OpenOk
600
+ longlong :staged_size
601
+ end
602
+
603
+ class Stage
604
+ end
605
+
606
+ class Publish
607
+ short :ticket
608
+ shortstr :exchange
609
+ shortstr :routing_key
610
+ bit :mandatory
611
+ bit :immediate
612
+ shortstr :identifier
613
+ end
614
+
615
+ class Return
616
+ short :reply_code
617
+ shortstr :reply_text
618
+ shortstr :exchange
619
+ shortstr :routing_key
620
+ end
621
+
622
+ class Deliver
623
+ shortstr :consumer_tag
624
+ longlong :delivery_tag
625
+ bit :redelivered
626
+ shortstr :exchange
627
+ shortstr :routing_key
628
+ shortstr :identifier
629
+ end
630
+
631
+ class Ack
632
+ longlong :delivery_tag
633
+ bit :multiple
634
+ end
635
+
636
+ class Reject
637
+ longlong :delivery_tag
638
+ bit :requeue
639
+ end
640
+
641
+ end
642
+
643
+ class Stream
644
+ shortstr :content_type
645
+ shortstr :content_encoding
646
+ table :headers
647
+ octet :priority
648
+ timestamp :timestamp
649
+
650
+ class Qos < Method( 10, :qos ); end
651
+ class QosOk < Method( 11, :qos_ok ); end
652
+ class Consume < Method( 20, :consume ); end
653
+ class ConsumeOk < Method( 21, :consume_ok ); end
654
+ class Cancel < Method( 30, :cancel ); end
655
+ class CancelOk < Method( 31, :cancel_ok ); end
656
+ class Publish < Method( 40, :publish ); end
657
+ class Return < Method( 50, :return ); end
658
+ class Deliver < Method( 60, :deliver ); end
659
+
660
+ class Qos
661
+ long :prefetch_size
662
+ short :prefetch_count
663
+ long :consume_rate
664
+ bit :global
665
+ end
666
+
667
+ class QosOk
668
+ end
669
+
670
+ class Consume
671
+ short :ticket
672
+ shortstr :queue
673
+ shortstr :consumer_tag
674
+ bit :no_local
675
+ bit :exclusive
676
+ bit :nowait
677
+ end
678
+
679
+ class ConsumeOk
680
+ shortstr :consumer_tag
681
+ end
682
+
683
+ class Cancel
684
+ shortstr :consumer_tag
685
+ bit :nowait
686
+ end
687
+
688
+ class CancelOk
689
+ shortstr :consumer_tag
690
+ end
691
+
692
+ class Publish
693
+ short :ticket
694
+ shortstr :exchange
695
+ shortstr :routing_key
696
+ bit :mandatory
697
+ bit :immediate
698
+ end
699
+
700
+ class Return
701
+ short :reply_code
702
+ shortstr :reply_text
703
+ shortstr :exchange
704
+ shortstr :routing_key
705
+ end
706
+
707
+ class Deliver
708
+ shortstr :consumer_tag
709
+ longlong :delivery_tag
710
+ shortstr :exchange
711
+ shortstr :queue
712
+ end
713
+
714
+ end
715
+
716
+ class Tx
717
+
718
+ class Select < Method( 10, :select ); end
719
+ class SelectOk < Method( 11, :select_ok ); end
720
+ class Commit < Method( 20, :commit ); end
721
+ class CommitOk < Method( 21, :commit_ok ); end
722
+ class Rollback < Method( 30, :rollback ); end
723
+ class RollbackOk < Method( 31, :rollback_ok ); end
724
+
725
+ class Select
726
+ end
727
+
728
+ class SelectOk
729
+ end
730
+
731
+ class Commit
732
+ end
733
+
734
+ class CommitOk
735
+ end
736
+
737
+ class Rollback
738
+ end
739
+
740
+ class RollbackOk
741
+ end
742
+
743
+ end
744
+
745
+ class Dtx
746
+
747
+ class Select < Method( 10, :select ); end
748
+ class SelectOk < Method( 11, :select_ok ); end
749
+ class Start < Method( 20, :start ); end
750
+ class StartOk < Method( 21, :start_ok ); end
751
+
752
+ class Select
753
+ end
754
+
755
+ class SelectOk
756
+ end
757
+
758
+ class Start
759
+ shortstr :dtx_identifier
760
+ end
761
+
762
+ class StartOk
763
+ end
764
+
765
+ end
766
+
767
+ class Tunnel
768
+ table :headers
769
+ shortstr :proxy_name
770
+ shortstr :data_name
771
+ octet :durable
772
+ octet :broadcast
773
+
774
+ class Request < Method( 10, :request ); end
775
+
776
+ class Request
777
+ table :meta_data
778
+ end
779
+
780
+ end
781
+
782
+ class Test
783
+
784
+ class Integer < Method( 10, :integer ); end
785
+ class IntegerOk < Method( 11, :integer_ok ); end
786
+ class String < Method( 20, :string ); end
787
+ class StringOk < Method( 21, :string_ok ); end
788
+ class Table < Method( 30, :table ); end
789
+ class TableOk < Method( 31, :table_ok ); end
790
+ class Content < Method( 40, :content ); end
791
+ class ContentOk < Method( 41, :content_ok ); end
792
+
793
+ class Integer
794
+ octet :integer_1
795
+ short :integer_2
796
+ long :integer_3
797
+ longlong :integer_4
798
+ octet :operation
799
+ end
800
+
801
+ class IntegerOk
802
+ longlong :result
803
+ end
804
+
805
+ class String
806
+ shortstr :string_1
807
+ longstr :string_2
808
+ octet :operation
809
+ end
810
+
811
+ class StringOk
812
+ longstr :result
813
+ end
814
+
815
+ class Table
816
+ table :table
817
+ octet :integer_op
818
+ octet :string_op
819
+ end
820
+
821
+ class TableOk
822
+ longlong :integer_result
823
+ longstr :string_result
824
+ end
825
+
826
+ class Content
827
+ end
828
+
829
+ class ContentOk
830
+ long :content_checksum
831
+ end
832
+
833
+ end
834
+
835
+ end
836
+ end