コード例 #1
0
        public void Multiple_Consumer_Based_Pipeline_Harmonizes()
        {
            using (PipeExtsTest.Consumer <object>(2).Pipeline())
            {
            }

            using (PipeExtsTest.Consumer <List <object> >(2).Pipeline(2, 0))
            {
            }

            using (PipeExtsTest.Consumer <object>(2).Pipeline(IdentityAwaitableAdapter <object> .Default))
            {
            }

            using (PipeExtsTest.ConsumerFunc(PipeExtsTest.Consumer <object>(2))
                   .Pipeline())
            {
            }

            using (PipeExtsTest.ConsumerFunc(PipeExtsTest.Consumer <List <object> >(2))
                   .Pipeline(2, 0))
            {
            }

            using (PipeExtsTest.ConsumerFunc(PipeExtsTest.Consumer <object>(2))
                   .Pipeline(IdentityAwaitableAdapter <object> .Default))
            {
            }

            using (PipeExtsTest.ConsumerAction(PipeExtsTest.Consumer <object>(2))
                   .Pipeline())
            {
            }

            using (PipeExtsTest.ConsumerAction(PipeExtsTest.Consumer <List <object> >(2))
                   .Pipeline(2, 0))
            {
            }

            using (PipeExtsTest.ConsumerAction(PipeExtsTest.Consumer <object>(2))
                   .Pipeline(IdentityAwaitableAdapter <object> .Default))
            {
            }
        }
コード例 #2
0
        public async Task Single_Consumer_Based_Pipeline_Harmonizes()
        {
#if !NETFRAMEWORK && !NETCOREAPP2_2
            await
#endif
            using (
                PipeExtsTest.Consumer <object>().Pipeline()
#if !NETFRAMEWORK && !NETCOREAPP2_2
                .ConfigureAwait(false)
#endif
                )
            {
            }

#if !NETFRAMEWORK && !NETCOREAPP2_2
            await
#endif
            using (
                PipeExtsTest.Consumer <List <object> >().Pipeline(2, 0)
#if !NETFRAMEWORK && !NETCOREAPP2_2
                .ConfigureAwait(false)
#endif
                )
            {
            }

#if !NETFRAMEWORK && !NETCOREAPP2_2
            await
#endif
            using (
                PipeExtsTest.Consumer <object>().Pipeline(IdentityAwaitableAdapter <object> .Default)
#if !NETFRAMEWORK && !NETCOREAPP2_2
                .ConfigureAwait(false)
#endif
                )
            {
            }

#if !NETFRAMEWORK && !NETCOREAPP2_2
            await
#endif
            using (
                PipeExtsTest.ConsumerFunc(PipeExtsTest.Consumer <object>()).Pipeline()
#if !NETFRAMEWORK && !NETCOREAPP2_2
                .ConfigureAwait(false)
#endif
                )
            {
            }

#if !NETFRAMEWORK && !NETCOREAPP2_2
            await
#endif
            using (
                PipeExtsTest.ConsumerFunc(PipeExtsTest.Consumer <List <object> >()).Pipeline(2, 0)
#if !NETFRAMEWORK && !NETCOREAPP2_2
                .ConfigureAwait(false)
#endif
                )
            {
            }

#if !NETFRAMEWORK && !NETCOREAPP2_2
            await
#endif
            using (
                PipeExtsTest.ConsumerFunc(PipeExtsTest.Consumer <object>())
                .Pipeline(IdentityAwaitableAdapter <object> .Default)
#if !NETFRAMEWORK && !NETCOREAPP2_2
                .ConfigureAwait(false)
#endif
                )
            {
            }

#if !NETFRAMEWORK && !NETCOREAPP2_2
            await
#endif
            using (
                PipeExtsTest.ConsumerAction(PipeExtsTest.Consumer <object>()).Pipeline()
#if !NETFRAMEWORK && !NETCOREAPP2_2
                .ConfigureAwait(false)
#endif
                )
            {
            }

#if !NETFRAMEWORK && !NETCOREAPP2_2
            await
#endif
            using (
                PipeExtsTest.ConsumerAction(PipeExtsTest.Consumer <List <object> >()).Pipeline(2, 0)
#if !NETFRAMEWORK && !NETCOREAPP2_2
                .ConfigureAwait(false)
#endif
                )
            {
            }

#if !NETFRAMEWORK && !NETCOREAPP2_2
            await
#endif
            using (
                PipeExtsTest.ConsumerAction(PipeExtsTest.Consumer <object>())
                .Pipeline(IdentityAwaitableAdapter <object> .Default)
#if !NETFRAMEWORK && !NETCOREAPP2_2
                .ConfigureAwait(false)
#endif
                )
            {
            }

            await Task.CompletedTask;
        }