コード例 #1
0
        public static byte[] SaveEnvelopeData(this IEnvelopeStreamer streamer, object message, Action <EnvelopeBuilder> build = null)
        {
            var builder = new EnvelopeBuilder(Guid.NewGuid().ToString());

            builder.AddItem(message);
            if (null != build)
            {
                build(builder);
            }
            return(streamer.SaveEnvelopeData(builder.Build()));
        }
コード例 #2
0
        void InnerSendBatch(Action <EnvelopeBuilder> configure, object[] messageItems)
        {
            var id = _idGenerator();

            var builder = new EnvelopeBuilder(id);

            foreach (var item in messageItems)
            {
                builder.AddItem(item);
            }

            configure(builder);
            var envelope = builder.Build();

            SendEnvelope(envelope);
        }
コード例 #3
0
        protected override ImmutableEnvelope RoundtripViaSerializer(EnvelopeBuilder builder)
        {
            var bytes = _streamer.SaveEnvelopeData(builder.Build());

            return(_streamer.ReadAsEnvelopeData(bytes));
        }