Exemple #1
0
        public async Task Go()
        {
            Data d         = new Data();
            var  mqService = mQServiceContainer.GetService(this);

            using (var ms = new PooledMemoryStream())
            {
                Serializer.Serialize(ms, d);
                var data = new MessageInfo()
                {
                    TypeCode    = d.GetType().FullName,
                    BinaryBytes = ms.ToArray()
                };
                ms.Position = 0;
                ms.SetLength(0);
                Serializer.Serialize(ms, data);
                for (int i = 0; i < 2; i++)
                {
                    await mqService.Result.Publish(ms.ToArray(), Guid.NewGuid().ToString());

                    Console.WriteLine(i);
                }
            }
        }
Exemple #2
0
 protected virtual ValueTask <IMQService> GetMQService()
 {
     return(mQServiceContainer.GetService(this));
 }