Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/daichi-m/jach
/ functions
Functions
154 in github.com/daichi-m/jach
⨍
Functions
154
◇
Types & classes
43
↓ 39 callers
Method
write
Writes the given message to the destination. If the destination does not have space, the write blocks until space is freed up in the destination. @pa
src/main/java/io/github/daichim/jach/internal/Writable.java:24
↓ 25 callers
Method
selectCase
Create a {@link ChannelAction} for the given {@link Channel} with a given {@link Consumer} action that is going to be executed for each message in the
src/main/java/io/github/daichim/jach/JachChannels.java:110
↓ 22 callers
Method
close
Closes the channel. Read and write operation on a closed channel would throw a {@link ClosedChannelException}
src/main/java/io/github/daichim/jach/channel/Channel.java:38
↓ 22 callers
Method
read
Reads the next message from the source. If there are no elements in the source, the read blocks until an element is available. If the source declared
src/main/java/io/github/daichim/jach/internal/Readable.java:26
↓ 13 callers
Method
copyOf
Returns a copy of the message that should be stored in the in-memory data structure of the {@link Channel}. @param message The message to store in th
src/main/java/io/github/daichim/jach/channel/copier/Copier.java:25
↓ 11 callers
Method
selector
Convenience method to create a new {@link Selector} from the given set of {@link ChannelAction}s. @param actions The list of {@link ChannelAction}s t
src/main/java/io/github/daichim/jach/JachChannels.java:123
↓ 10 callers
Method
next
Gets the next message for this thread from the underlying channel. If no message is available, this calls blocks until a new message is read in this t
src/main/java/io/github/daichim/jach/internal/ChannelIterator.java:48
↓ 9 callers
Method
accept
(Void unused)
src/main/java/io/github/daichim/jach/channel/Action.java:12
↓ 9 callers
Method
run
()
src/main/java/io/github/daichim/jach/routines/Routines.java:10
↓ 8 callers
Method
tryRead
Tries to read a message from the source. If there is no message, the method will return {@literal null}. @return The next message from the source if
src/main/java/io/github/daichim/jach/internal/Readable.java:48
↓ 7 callers
Method
canRead
The source can be read from. It does not necessarily means the read will succeed as it can get blocked or timeout, but it means that the source still
src/main/java/io/github/daichim/jach/internal/Readable.java:56
↓ 7 callers
Method
getId
Returns a unique identifier for the {@link Channel}. @return A unique identifier for this {@link Channel}
src/main/java/io/github/daichim/jach/channel/Channel.java:52
↓ 7 callers
Method
tryWrite
Tries to write a message to the destination. If the destination does not have free space, the call returns immediately with {@literal false}. @param
src/main/java/io/github/daichim/jach/internal/Writable.java:46
↓ 6 callers
Method
createChannels
()
src/test/java/io/github/daichim/jach/channel/selector/SelectorTest.java:38
↓ 6 callers
Method
forEach
Perform an action over the messages as received in the current thread from the channel. This method will not propagate the {@link NoSuchChannelElement
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:423
↓ 6 callers
Method
untilDone
Runs an loop over all the channels and executes the action associated with that channel as and when a message is received on that channel. The loop br
src/main/java/io/github/daichim/jach/channel/selector/Selector.java:205
↓ 5 callers
Method
registerAfterWriteAction
For internal uses only . Register an {@link AfterWriteAction} to this {@link Channel}.
src/main/java/io/github/daichim/jach/channel/Channel.java:65
↓ 4 callers
Method
close
()
src/main/java/io/github/daichim/jach/channel/selector/Selector.java:134
↓ 4 callers
Method
remove
Remove is unsupported operation for a channel. This always throws an {@link UnsupportedOperationException}. @throws UnsupportedOperationException Alw
src/main/java/io/github/daichim/jach/internal/ChannelIterator.java:69
↓ 4 callers
Method
select
Waits for a message to be recieved on any of the channels associated with the {@link ChannelAction}s of this {@link Selector} and execute the action c
src/main/java/io/github/daichim/jach/channel/selector/Selector.java:162
↓ 4 callers
Method
tick
()
src/test/java/io/github/daichim/jach/time/TickerTest.java:112
↓ 3 callers
Method
canWrite
The destination allows write to happen. It does not necessarily means the write will succeed, it can block or timeout if there is no space, but if spa
src/main/java/io/github/daichim/jach/internal/Writable.java:55
↓ 3 callers
Method
closeChannel
(String channel)
src/main/java/io/github/daichim/jach/channel/selector/Selector.java:295
↓ 3 callers
Method
getAvailable
Available slots in the channel. This is the difference between the capacity and the number of messages already in the channel. @return The number of
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:396
↓ 3 callers
Method
isOpen
Checks if the channel has been closed. @return {@literal true}, if the channel has been closed, {@literal false} otherwise.
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:348
↓ 3 callers
Method
markDone
Mark the iterator as done (i.e., the underlying channel has been closed).
src/main/java/io/github/daichim/jach/internal/ChannelIterator.java:93
↓ 3 callers
Method
of
Creates a new {@link Selector} from the given set of {@link ChannelAction}s. @param actions The list of {@link ChannelAction}s that this {@link Selec
src/main/java/io/github/daichim/jach/channel/selector/Selector.java:103
↓ 3 callers
Method
runAfterWriteActions
()
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:199
↓ 2 callers
Method
afterFunc
Execute an action after the given duration in a different thread. @param duration The duration of time @param unit The unit that is associated wi
src/main/java/io/github/daichim/jach/JachTime.java:93
↓ 2 callers
Method
blockedRead
(Optional<Integer> timeout, Optional<TimeUnit> unit)
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:269
↓ 2 callers
Method
blockedWrite
(T message, Optional<Integer> timeout, Optional<TimeUnit> unit)
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:154
↓ 2 callers
Method
hasNext
Returns {@literal true} if the parent channel has not been closed, {@literal false} otherwise. @return {@literal true} if the parent channel has not
src/main/java/io/github/daichim/jach/internal/ChannelIterator.java:33
↓ 2 callers
Method
isOpen
Returns {@literal true} in case the channel is open, else return {@literal false} @return {@literal true} if the channel has been open, {@literal fal
src/main/java/io/github/daichim/jach/channel/Channel.java:45
↓ 2 callers
Method
make
Create a generic {@link BufferedChannel} of the given capacity. It uses {@link KryoCopier} to copy the messages to the channel. @param type The c
src/main/java/io/github/daichim/jach/JachChannels.java:82
↓ 2 callers
Method
timer
Returns a new {@link Timer} instance which sends the current time on it's {@link Channel} once the timer expires. @param duration The duration after
src/main/java/io/github/daichim/jach/JachTime.java:79
↓ 2 callers
Method
untilOrDefault
Runs an loop over all the channels and executes the action associated with that channel as and when a message is received on that channel. When no mes
src/main/java/io/github/daichim/jach/channel/selector/Selector.java:253
↓ 1 callers
Method
close
Closes the timer. Anu subsequent operation on the timer would throw a {@link ClosedChannelException}.
src/main/java/io/github/daichim/jach/time/Timer.java:49
↓ 1 callers
Method
createAFW
(ChannelAction ca)
src/main/java/io/github/daichim/jach/channel/selector/Selector.java:117
↓ 1 callers
Method
forEachRemaining
Runs the give action for each of the remaining messages that are read in this thread from the underlying channel, until the channel is closed. When th
src/main/java/io/github/daichim/jach/internal/ChannelIterator.java:79
↓ 1 callers
Method
getCapacity
The capacity of this {@link BufferedChannel}. Capacity is the number of messages that can be inserted into the channel without a read before the write
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:386
↓ 1 callers
Method
go
Run a routine on JaCh's executor.
src/main/java/io/github/daichim/jach/JachChannels.java:140
↓ 1 callers
Method
makeStr
Create a {@link BufferedChannel} that stores strings with the given capacity. It uses {@link RefCopier} to copy the messages to the channel. @param c
src/main/java/io/github/daichim/jach/JachChannels.java:37
↓ 1 callers
Method
onWrite
()
src/main/java/io/github/daichim/jach/internal/AfterWriteAction.java:12
↓ 1 callers
Method
read
Reads the next message from the channel. If the channel is currently empty, the thread blocks until a message is available for reading. @throws NoSuc
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:215
↓ 1 callers
Method
reset
Resets the duration of the timer to the new duration. @param duration The new duration for the {@link Timer} @param unit The unit corresponding t
src/main/java/io/github/daichim/jach/time/Timer.java:63
↓ 1 callers
Method
reset
Resets the tick interval of this ticker to the new interval. Subsequent events on this ticker will occur after the given interval. @param duration Th
src/main/java/io/github/daichim/jach/time/Ticker.java:59
↓ 1 callers
Method
spliterator
{@link Spliterator} is not supported for a {@link Channel}. It will throw a {@link UnsupportedOperationException}. @see Channel#spliterator()
src/main/java/io/github/daichim/jach/channel/Channel.java:73
↓ 1 callers
Method
stop
Stops the {@link Ticker} from sending further events. This method also cleans up existing resources held by this {@link Ticker} instance. Any subseque
src/main/java/io/github/daichim/jach/time/Ticker.java:44
↓ 1 callers
Method
write
Writes a non-null message to the channel. If the channel does not have enough space to write the message, the thread is blocked until space is availab
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:103
Method
BufferedChannel
(int capacity, Class<T> clazz, Copier<T> copier)
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:77
Method
ChannelIterator
(BufferedChannel<T> parentChannel)
src/main/java/io/github/daichim/jach/internal/ChannelIterator.java:21
Method
ClosedChannelException
()
src/main/java/io/github/daichim/jach/exception/ClosedChannelException.java:13
Method
CopyException
()
src/main/java/io/github/daichim/jach/exception/CopyException.java:4
Method
KryoCopier
Initializes a {@link KryoCopier} with default instance of Kryo and Serializer.
src/main/java/io/github/daichim/jach/channel/copier/KryoCopier.java:23
Method
MessageValidator
()
src/test/java/io/github/daichim/jach/utils/MessageValidator.java:15
Method
NoSuchChannelElementException
()
src/main/java/io/github/daichim/jach/exception/NoSuchChannelElementException.java:16
Method
Selector
()
src/main/java/io/github/daichim/jach/channel/selector/Selector.java:85
Method
TickCounter
()
src/test/java/io/github/daichim/jach/time/TickerTest.java:107
Method
Ticker
(long duration, TimeUnit unit, ScheduledExecutorService executor)
src/main/java/io/github/daichim/jach/time/Ticker.java:27
Method
TimeoutException
()
src/main/java/io/github/daichim/jach/exception/TimeoutException.java:7
Method
Timer
(long duration, TimeUnit unit, ScheduledExecutorService executor)
src/main/java/io/github/daichim/jach/time/Timer.java:31
Method
TooManySelectorException
()
src/main/java/io/github/daichim/jach/exception/TooManySelectorException.java:16
Method
UnbufferedChannel
(Class<T> clazz)
src/main/java/io/github/daichim/jach/channel/UnbufferedChannel.java:15
Method
after
Returns a {@link Channel} which will send the current time after the given duration expires. @param duration The duration after which to send the eve
src/main/java/io/github/daichim/jach/JachTime.java:53
Method
afterFuncCancelledTest
()
src/test/java/io/github/daichim/jach/time/TimerTest.java:77
Method
afterFuncTest
()
src/test/java/io/github/daichim/jach/time/TimerTest.java:57
Method
afterWriteActionsBlockingTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:224
Method
afterWriteActionsTimeoutTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:252
Method
afterWriteActionsTryWriteTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:283
Method
canRead
Returns {@literal true} if the channel can be read. @return {@literal true} if the channel can be read, else {@literal false}.
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:264
Method
canReadTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:445
Method
canWrite
Returns {@literal true} if the channel can be written to. @return {@literal true} if the channel can be written to, else {@literal false}.
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:194
Method
canWriteTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:213
Method
channelAvailabilityTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:545
Method
channelCapacityTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:539
Method
cleanup
()
src/test/java/io/github/daichim/jach/channel/selector/SelectorTest.java:331
Method
cleanupClass
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:601
Method
close
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:235
Method
close
Closes this channel. On closure of this channel, all the threads that are stuck in {@link #read()} or {@link #write(Object)} are interrupted. The iter
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:311
Method
closeAfterWriteActionTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:521
Method
closeChannel
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:591
Method
closeChannelReadInterruptTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:462
Method
closeChannelWriteInterruptTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:486
Method
copyOf
@see Copier#copyOf(Object)
src/main/java/io/github/daichim/jach/channel/copier/KryoCopier.java:50
Method
copyOf
@see Copier#copyOf(Object)
src/main/java/io/github/daichim/jach/channel/copier/RefCopier.java:14
Method
copyOfCustomSerializerTest
()
src/test/java/io/github/daichim/jach/channel/copier/KryoCopierTest.java:33
Method
copyOfDefaultSerializerTest
()
src/test/java/io/github/daichim/jach/channel/copier/KryoCopierTest.java:10
Method
forEachRemainingTest
()
src/test/java/io/github/daichim/jach/internal/ChannelIteratorTest.java:114
Method
forEachTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:564
Method
getDataType
Returns the type of the element that is stored in this {@link Channel} @return The concrete class of type T that is stored in this {@link Channel}.
src/main/java/io/github/daichim/jach/channel/Channel.java:59
Method
getDataType
@see Channel#getDataType()
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:366
Method
getId
Returns a unique id for this {@link Channel}. @return A unique id for this {@link Channel}.
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:358
Method
initializeChannelForWrite
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:47
Method
isChannelClosedTest
()
src/test/java/io/github/daichim/jach/channel/BufferedChannelTest.java:515
Method
iterator
Returns an {@link Iterator} to iterate over the channel. The iterator is a blocking iterator. If no elements are present in the channel the iterators
src/main/java/io/github/daichim/jach/channel/BufferedChannel.java:410
Method
makeInt
Create a {@link BufferedChannel} that stores integers with the given capacity. It uses {@link RefCopier} to copy the messages to the channel. @param
src/main/java/io/github/daichim/jach/JachChannels.java:59
Method
multiThreadSelectTest
()
src/test/java/io/github/daichim/jach/channel/selector/SelectorTest.java:88
Method
newMessage
()
src/test/java/io/github/daichim/jach/utils/MessageValidator.java:20
Method
normalTickerTest
()
src/test/java/io/github/daichim/jach/time/TickerTest.java:27
Method
normalTimerTest
()
src/test/java/io/github/daichim/jach/time/TimerTest.java:22
next →
1–100 of 154, ranked by callers