github.com/lirm/aeron-go@v0.0.0-20230415210743-920325491dc4/aeron/image.go (about)

     1  // Copyright 2016 Stanislav Liberman
     2  // Copyright 2022 Steven Stern
     3  //
     4  // Licensed under the Apache License, Version 2.0 (the "License");
     5  // you may not use this file except in compliance with the License.
     6  // You may obtain a copy of the License at
     7  //
     8  // http://www.apache.org/licenses/LICENSE-2.0
     9  //
    10  // Unless required by applicable law or agreed to in writing, software
    11  // distributed under the License is distributed on an "AS IS" BASIS,
    12  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  // See the License for the specific language governing permissions and
    14  // limitations under the License.
    15  
    16  package aeron
    17  
    18  import "github.com/lirm/aeron-go/aeron/logbuffer/term"
    19  
    20  // Image is a Java-style interface for the image struct.  This is to allow dependency injection and testing of
    21  // the many structs that use image, without deviating from the existing function signatures and code structure.
    22  type Image interface {
    23  	IsClosed() bool
    24  	Poll(handler term.FragmentHandler, fragmentLimit int) int
    25  	BoundedPoll(handler term.FragmentHandler, limitPosition int64, fragmentLimit int) int
    26  	ControlledPoll(handler term.ControlledFragmentHandler, fragmentLimit int) int
    27  	Position() int64
    28  	IsEndOfStream() bool
    29  	SessionID() int32
    30  	CorrelationID() int64
    31  	SubscriptionRegistrationID() int64
    32  	TermBufferLength() int32
    33  	ActiveTransportCount() int32
    34  	Close() error
    35  }