blob: fa0e2fa56210fa28c57a3d44ce6dbad2081180ae [file] [log] [blame]
Jan Tattermuscha5272b62015-04-30 11:56:46 -07001#region Copyright notice and license
Jan Tattermuscha7fff862015-02-13 11:08:08 -08002
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003// Copyright 2015 gRPC authors.
Craig Tiller190d3602015-02-18 09:23:38 -08004//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
Craig Tiller190d3602015-02-18 09:23:38 -08008//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009// http://www.apache.org/licenses/LICENSE-2.0
Craig Tiller190d3602015-02-18 09:23:38 -080010//
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
Jan Tattermuscha7fff862015-02-13 11:08:08 -080016
17#endregion
18
Jan Tattermuscha7608b02015-02-03 17:54:38 -080019using System;
Jan Tattermuscha7608b02015-02-03 17:54:38 -080020using System.Collections.Generic;
Jan Tattermuscha5272b62015-04-30 11:56:46 -070021using System.Linq;
22using System.Text;
Jan Tattermusch30868622015-02-19 09:22:33 -080023using System.Threading.Tasks;
Jan Tattermuscha7608b02015-02-03 17:54:38 -080024
Jan Tattermuscha5272b62015-04-30 11:56:46 -070025namespace Grpc.Core
Jan Tattermuscha7608b02015-02-03 17:54:38 -080026{
Jan Tattermuscha5272b62015-04-30 11:56:46 -070027 /// <summary>
28 /// A writable stream of messages.
29 /// </summary>
Jan Tattermusch12855fc2015-08-24 16:43:23 -070030 /// <typeparam name="T">The message type.</typeparam>
Jan Tattermuscha5272b62015-04-30 11:56:46 -070031 public interface IAsyncStreamWriter<T>
Jan Tattermuscha7608b02015-02-03 17:54:38 -080032 {
Jan Tattermuscha5272b62015-04-30 11:56:46 -070033 /// <summary>
Jan Tattermusch7ca61792015-05-18 14:28:22 -070034 /// Writes a single asynchronously. Only one write can be pending at a time.
Jan Tattermuscha5272b62015-04-30 11:56:46 -070035 /// </summary>
36 /// <param name="message">the message to be written. Cannot be null.</param>
Jan Tattermusch43dc50b2015-05-18 15:27:19 -070037 Task WriteAsync(T message);
Jan Tattermuschbff90ac2015-08-06 21:30:26 -070038
39 /// <summary>
40 /// Write options that will be used for the next write.
41 /// If null, default options will be used.
42 /// Once set, this property maintains its value across subsequent
43 /// writes.
Jan Tattermusch12855fc2015-08-24 16:43:23 -070044 /// </summary>
Jan Tattermuschbff90ac2015-08-06 21:30:26 -070045 WriteOptions WriteOptions { get; set; }
Jan Tattermuscha7608b02015-02-03 17:54:38 -080046 }
47}