| /external/rust/crates/tracing-subscriber/tests/ |
| D | option.rs | 2 use tracing_core::{subscriber::Interest, LevelFilter, Metadata, Subscriber}; 8 impl<S: Subscriber> tracing_subscriber::Layer<S> for BasicLayer { 25 let subscriber = tracing_subscriber::registry().with(LevelFilter::INFO); in just_layer() localVariable 26 assert_eq!(subscriber.max_level_hint(), Some(LevelFilter::INFO)); in just_layer() 31 let subscriber = tracing_subscriber::registry() in subscriber_and_option_some_layer() localVariable 34 assert_eq!(subscriber.max_level_hint(), Some(LevelFilter::DEBUG)); in subscriber_and_option_some_layer() 40 let subscriber = tracing_subscriber::registry() in subscriber_and_option_none_layer() localVariable 43 assert_eq!(subscriber.max_level_hint(), Some(LevelFilter::ERROR)); in subscriber_and_option_none_layer() 49 let subscriber = tracing_subscriber::registry().with(None::<LevelFilter>); in just_option_some_layer() localVariable 50 assert_eq!(subscriber.max_level_hint(), Some(LevelFilter::OFF)); in just_option_some_layer() [all …]
|
| /external/rust/crates/tracing-core/src/ |
| D | dispatcher.rs | 1 //! Dispatches trace events to [`Subscriber`]s. 5 //! to the subscriber that collects it. 11 //! current subscriber. 13 //! ## Setting the Default Subscriber 15 //! By default, the current subscriber is an empty implementation that does 16 //! nothing. To use a subscriber implementation, it must be set as the default. 18 //! [`set_global_default`]. `with_default` sets the default subscriber for the 19 //! duration of a scope, while `set_global_default` sets a default subscriber 22 //! To use either of these functions, we must first wrap our subscriber in a 23 //! [`Dispatch`], a cloneable, type-erased reference to a subscriber. For [all …]
|
| D | subscriber.rs | 13 /// trace data should implement the `Subscriber` interface. This trait is 16 /// subscriber implementations more modular or improve the ergonomics of writing 19 /// A subscriber is responsible for the following: 21 /// IDs. Implicitly, this means the subscriber may determine the strategy for 30 /// When a span is entered or exited, the subscriber is provided only with the 32 /// that it is up to the subscriber to determine whether and how span _data_ — 35 /// point, the subscriber _may_ choose to store the associated data if it will 37 /// not be needed by the implementations of `enter` and `exit`, the subscriber 42 /// Some trait methods on `Subscriber` have default implementations, either in 43 /// order to reduce the surface area of implementing `Subscriber`, or for [all …]
|
| /external/aws-sdk-java-v2/utils/src/test/java/software/amazon/awssdk/utils/async/ |
| D | ByteBufferStoringSubscriberTest.java | 63 ByteBufferStoringSubscriber subscriber = new ByteBufferStoringSubscriber(3); in doesNotRequestMoreThanMaxBytes() local 66 subscriber.onSubscribe(subscription); in doesNotRequestMoreThanMaxBytes() 69 subscriber.onNext(fullByteBufferOfSize(2)); in doesNotRequestMoreThanMaxBytes() 72 subscriber.onNext(fullByteBufferOfSize(0)); in doesNotRequestMoreThanMaxBytes() 75 subscriber.onNext(fullByteBufferOfSize(1)); in doesNotRequestMoreThanMaxBytes() 81 ByteBufferStoringSubscriber subscriber = new ByteBufferStoringSubscriber(3); in canStoreMoreThanMaxBytesButWontAskForMoreUntilBelowMax() local 84 subscriber.onSubscribe(subscription); in canStoreMoreThanMaxBytesButWontAskForMoreUntilBelowMax() 87 subscriber.onNext(fullByteBufferOfSize(1)); // After: Storing 1 in canStoreMoreThanMaxBytesButWontAskForMoreUntilBelowMax() 90 subscriber.onNext(fullByteBufferOfSize(50)); // After: Storing 51 in canStoreMoreThanMaxBytesButWontAskForMoreUntilBelowMax() 91 subscriber.transferTo(emptyByteBufferOfSize(48)); // After: Storing 3 in canStoreMoreThanMaxBytesButWontAskForMoreUntilBelowMax() [all …]
|
| D | SimplePublisherTest.java | 36 import org.reactivestreams.Subscriber; 54 StoringSubscriber<Integer> subscriber = new StoringSubscriber<>(1); in immediateSuccessWorks() local 55 publisher.subscribe(subscriber); in immediateSuccessWorks() 58 assertThat(subscriber.poll().get().type()).isEqualTo(EventType.ON_COMPLETE); in immediateSuccessWorks() 59 assertThat(subscriber.poll()).isNotPresent(); in immediateSuccessWorks() 67 StoringSubscriber<Integer> subscriber = new StoringSubscriber<>(1); in immediateFailureWorks() local 68 publisher.subscribe(subscriber); in immediateFailureWorks() 71 assertThat(subscriber.peek().get().type()).isEqualTo(EventType.ON_ERROR); in immediateFailureWorks() 72 assertThat(subscriber.peek().get().runtimeError()).isEqualTo(error); in immediateFailureWorks() 74 subscriber.poll(); in immediateFailureWorks() [all …]
|
| D | StoringSubscriberTest.java | 52 StoringSubscriber<Integer> subscriber = new StoringSubscriber<>(2); in doesNotStoreMoreThanMaxElements() local 55 subscriber.onSubscribe(subscription); in doesNotStoreMoreThanMaxElements() 58 subscriber.onNext(0); in doesNotStoreMoreThanMaxElements() 59 subscriber.onNext(0); in doesNotStoreMoreThanMaxElements() 60 subscriber.peek(); in doesNotStoreMoreThanMaxElements() 63 subscriber.poll(); in doesNotStoreMoreThanMaxElements() 64 subscriber.poll(); in doesNotStoreMoreThanMaxElements() 67 assertThat(subscriber.peek()).isNotPresent(); in doesNotStoreMoreThanMaxElements() 73 StoringSubscriber<Integer> subscriber = new StoringSubscriber<>(2); in returnsEmptyEventWithOutstandingDemand() local 74 subscriber.onSubscribe(mock(Subscription.class)); in returnsEmptyEventWithOutstandingDemand() [all …]
|
| D | InputStreamSubscriberTest.java | 42 import org.reactivestreams.Subscriber; 48 private InputStreamSubscriber subscriber; field in InputStreamSubscriberTest 53 subscriber = new InputStreamSubscriber(); in setup() 58 publisher.subscribe(subscriber); in onComplete_returnsEndOfStream_onRead() 60 assertThat(subscriber.read()).isEqualTo(-1); in onComplete_returnsEndOfStream_onRead() 61 assertThat(subscriber.read(new byte[1])).isEqualTo(-1); in onComplete_returnsEndOfStream_onRead() 62 assertThat(subscriber.read(new byte[1], 0, 1)).isEqualTo(-1); in onComplete_returnsEndOfStream_onRead() 69 publisher.subscribe(subscriber); in onError_throws_onRead() 71 assertThatThrownBy(() -> subscriber.read()).isEqualTo(exception); in onError_throws_onRead() 72 assertThatThrownBy(() -> subscriber.read(new byte[1])).isEqualTo(exception); in onError_throws_onRead() [all …]
|
| /external/aws-sdk-java-v2/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/ |
| D | ByteBuffersAsyncRequestBodyTest.java | 33 import org.reactivestreams.Subscriber; 40 private static class TestSubscriber implements Subscriber<ByteBuffer> { 76 TestSubscriber subscriber = new TestSubscriber(); in subscriberIsMarkedAsCompleted() local 77 requestBody.subscribe(subscriber); in subscriberIsMarkedAsCompleted() 78 subscriber.request(1); in subscriberIsMarkedAsCompleted() 80 assertTrue(subscriber.onCompleteCalled); in subscriberIsMarkedAsCompleted() 81 assertEquals(1, subscriber.publishedResults.size()); in subscriberIsMarkedAsCompleted() 88 TestSubscriber subscriber = new TestSubscriber(); in subscriberIsMarkedAsCompletedWhenARequestIsMadeForMoreBuffersThanAreAvailable() local 89 requestBody.subscribe(subscriber); in subscriberIsMarkedAsCompletedWhenARequestIsMadeForMoreBuffersThanAreAvailable() 90 subscriber.request(2); in subscriberIsMarkedAsCompletedWhenARequestIsMadeForMoreBuffersThanAreAvailable() [all …]
|
| D | FileAsyncRequestBodyTest.java | 43 import org.reactivestreams.Subscriber; 84 asyncRequestBody.subscribe(new Subscriber<ByteBuffer>() { in readFully_doesNotRequestPastEndOfFile_receivesComplete() 121 ControllableSubscriber subscriber = new ControllableSubscriber(); in changingFile_fileGetsShorterThanAlreadyRead_failsBecauseTooShort() local 124 asyncRequestBody.subscribe(subscriber); in changingFile_fileGetsShorterThanAlreadyRead_failsBecauseTooShort() 125 subscriber.sub.request(1); in changingFile_fileGetsShorterThanAlreadyRead_failsBecauseTooShort() 126 assertTrue(subscriber.onNextSemaphore.tryAcquire(5, TimeUnit.SECONDS)); in changingFile_fileGetsShorterThanAlreadyRead_failsBecauseTooShort() 132 subscriber.sub.request(Long.MAX_VALUE); in changingFile_fileGetsShorterThanAlreadyRead_failsBecauseTooShort() 134 assertThatThrownBy(() -> subscriber.completed.get(5, TimeUnit.SECONDS)) in changingFile_fileGetsShorterThanAlreadyRead_failsBecauseTooShort() 144 ControllableSubscriber subscriber = new ControllableSubscriber(); in changingFile_fileGetsShorterThanExistingLength_failsBecauseTooShort() local 147 asyncRequestBody.subscribe(subscriber); in changingFile_fileGetsShorterThanExistingLength_failsBecauseTooShort() [all …]
|
| /external/rust/crates/tracing/src/ |
| D | subscriber.rs | 2 pub use tracing_core::subscriber::*; 8 /// Sets this [`Subscriber`] as the default for the current thread for the 11 /// The default subscriber is used when creating a new [`Span`] or 16 /// [`Subscriber`]: super::subscriber::Subscriber 20 pub fn with_default<T, S>(subscriber: S, f: impl FnOnce() -> T) -> T in with_default() 22 S: Subscriber + Send + Sync + 'static, in with_default() 24 crate::dispatcher::with_default(&crate::Dispatch::new(subscriber), f) in with_default() 27 /// Sets this subscriber as the global default for the duration of the entire program. 28 /// Will be used as a fallback if no thread-local subscriber has been set in a thread (using `with_… 37 /// [`Subscriber`]: super::subscriber::Subscriber [all …]
|
| /external/rust/crates/tracing/tests/ |
| D | span.rs | 10 subscriber::with_default, 18 // Create a mock subscriber that will return `true` on calls to in handles_to_the_same_span_are_equal() 19 // `Subscriber::enabled`, so that the spans will be constructed. We in handles_to_the_same_span_are_equal() 20 // won't enter any spans in this test, so the subscriber won't actually in handles_to_the_same_span_are_equal() 22 with_default(subscriber::mock().run(), || { in handles_to_the_same_span_are_equal() 38 with_default(subscriber::mock().run(), || { in handles_to_different_spans_are_not_equal() 57 with_default(subscriber::mock().run(), || { in handles_to_different_spans_with_the_same_metadata_are_not_equal() 69 let subscriber1 = subscriber::mock() in spans_always_go_to_the_subscriber_that_tagged_them() 77 let subscriber2 = subscriber::mock().run(); in spans_always_go_to_the_subscriber_that_tagged_them() 84 // Even though we enter subscriber 2's context, the subscriber that in spans_always_go_to_the_subscriber_that_tagged_them() [all …]
|
| D | event.rs | 13 subscriber::with_default, 23 let (subscriber, handle) = subscriber::mock() 38 with_default(subscriber, || { 59 let (subscriber, handle) = subscriber::mock() in event_with_message() 71 with_default(subscriber, || { in event_with_message() 81 let (subscriber, handle) = subscriber::mock() in message_without_delims() 99 with_default(subscriber, || { in message_without_delims() 110 let (subscriber, handle) = subscriber::mock() in string_message_without_delims() 125 with_default(subscriber, || { in string_message_without_delims() 136 let (subscriber, handle) = subscriber::mock() in one_with_everything() [all …]
|
| D | filters_dont_leak.rs | 13 let (subscriber, handle) = subscriber::mock() in spans_dont_leak() 19 let _guard = tracing::subscriber::set_default(subscriber); in spans_dont_leak() 24 let (subscriber2, handle2) = subscriber::mock() in spans_dont_leak() 34 tracing::subscriber::with_default(subscriber2, || { in spans_dont_leak() 35 println!("--- subscriber 2 is default ---"); in spans_dont_leak() 39 println!("--- subscriber 1 is default ---"); in spans_dont_leak() 53 let (subscriber, handle) = subscriber::mock() in events_dont_leak() 59 let _guard = tracing::subscriber::set_default(subscriber); in events_dont_leak() 63 let (subscriber2, handle2) = subscriber::mock() in events_dont_leak() 70 tracing::subscriber::with_default(subscriber2, || { in events_dont_leak() [all …]
|
| /external/rust/crates/tracing-subscriber/src/layer/ |
| D | tests.rs | 2 use tracing_core::subscriber::NoSubscriber; 6 impl<S: Subscriber> Layer<S> for NopLayer {} 10 impl<S: Subscriber> Layer<S> for NopLayer2 {} 16 impl<S: Subscriber> Layer<S> for StringLayer {} 18 impl<S: Subscriber> Layer<S> for StringLayer2 {} 21 impl<S: Subscriber> Layer<S> for StringLayer3 {} 25 impl Subscriber for StringSubscriber { 45 fn assert_subscriber(_s: impl Subscriber) {} in assert_subscriber() argument 46 fn assert_layer<S: Subscriber>(_l: &impl Layer<S>) {} in assert_layer() 92 .with_subscriber(StringSubscriber("subscriber")); in downcasts_to_subscriber() [all …]
|
| D | context.rs | 1 use tracing_core::{metadata::Metadata, span, subscriber::Subscriber, Event}; 8 /// wrapped [`Subscriber`]. 11 /// trait should ensure that the `Subscriber` type parameter is *also* bound by the 15 /// use tracing::Subscriber; 22 /// S: Subscriber + for<'a> LookupSpan<'a>, 29 /// [`Subscriber`]: tracing_core::Subscriber 34 subscriber: Option<&'a S>, field 53 S: Subscriber, 55 pub(super) fn new(subscriber: &'a S) -> Self { in new() 57 subscriber: Some(subscriber), in new() [all …]
|
| /external/guava/android/guava-tests/test/com/google/common/eventbus/ |
| D | SubscriberTest.java | 29 * Tests for {@link Subscriber}. 50 Subscriber s1 = Subscriber.create(bus, this, getTestSubscriberMethod("recordingMethod")); in testCreate() 51 assertThat(s1).isInstanceOf(Subscriber.SynchronizedSubscriber.class); in testCreate() 53 // a thread-safe method should not create a synchronized subscriber in testCreate() 54 Subscriber s2 = Subscriber.create(bus, this, getTestSubscriberMethod("threadSafeMethod")); in testCreate() 55 assertThat(s2).isNotInstanceOf(Subscriber.SynchronizedSubscriber.class); in testCreate() 60 Subscriber subscriber = Subscriber.create(bus, this, method); in testInvokeSubscriberMethod_basicMethodCall() local 62 subscriber.invokeSubscriberMethod(FIXTURE_ARGUMENT); in testInvokeSubscriberMethod_basicMethodCall() 64 assertTrue("Subscriber must call provided method", methodCalled); in testInvokeSubscriberMethod_basicMethodCall() 66 "Subscriber argument must be exactly the provided object.", in testInvokeSubscriberMethod_basicMethodCall() [all …]
|
| /external/guava/guava-tests/test/com/google/common/eventbus/ |
| D | SubscriberTest.java | 29 * Tests for {@link Subscriber}. 50 Subscriber s1 = Subscriber.create(bus, this, getTestSubscriberMethod("recordingMethod")); in testCreate() 51 assertThat(s1).isInstanceOf(Subscriber.SynchronizedSubscriber.class); in testCreate() 53 // a thread-safe method should not create a synchronized subscriber in testCreate() 54 Subscriber s2 = Subscriber.create(bus, this, getTestSubscriberMethod("threadSafeMethod")); in testCreate() 55 assertThat(s2).isNotInstanceOf(Subscriber.SynchronizedSubscriber.class); in testCreate() 60 Subscriber subscriber = Subscriber.create(bus, this, method); in testInvokeSubscriberMethod_basicMethodCall() local 62 subscriber.invokeSubscriberMethod(FIXTURE_ARGUMENT); in testInvokeSubscriberMethod_basicMethodCall() 64 assertTrue("Subscriber must call provided method", methodCalled); in testInvokeSubscriberMethod_basicMethodCall() 66 "Subscriber argument must be exactly the provided object.", in testInvokeSubscriberMethod_basicMethodCall() [all …]
|
| /external/rust/crates/tracing-attributes/tests/ |
| D | ret.rs | 5 use tracing::{subscriber::with_default, Level}; 23 let (subscriber, handle) = subscriber::mock() in test() 36 with_default(subscriber, ret); in test() 47 let (subscriber, handle) = subscriber::mock() in test_custom_target() 61 let subscriber = subscriber.with(filter); in test_custom_target() localVariable 63 with_default(subscriber, ret_with_target); in test_custom_target() 75 let (subscriber, handle) = subscriber::mock() in test_warn() 88 with_default(subscriber, ret_warn); in test_warn() 102 let (subscriber, handle) = subscriber::mock() in test_mut() 120 with_default(subscriber, || ret_mut(&mut 1)); in test_mut() [all …]
|
| D | err.rs | 1 use tracing::subscriber::with_default; 25 let (subscriber, handle) = subscriber::mock() in test() 33 with_default(subscriber, || err().ok()); in test() 46 let (subscriber, handle) = subscriber::mock() in test_early_return() 54 with_default(subscriber, || err_early_return().ok()); in test_early_return() 69 let (subscriber, handle) = subscriber::mock() in test_async() 86 with_default(subscriber, || { in test_async() 101 let (subscriber, handle) = subscriber::mock() in test_mut() 109 with_default(subscriber, || err_mut(&mut 0).ok()); in test_mut() 125 let (subscriber, handle) = subscriber::mock() in test_mut_async() [all …]
|
| /external/aws-sdk-java-v2/http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/nrs/ |
| D | HandlerPublisher.java | 29 import org.reactivestreams.Subscriber; 36 * This publisher supports only one subscriber. 38 …* All interactions with the subscriber are done from the handlers executor, hence, they provide th… 46 …ill release any messages that it drops (for example, messages that are buffered when the subscriber 47 …* cancels), but other than that, it does not release any messages. It is up to the subscriber to … 49 * If the subscriber cancels, the publisher will send a close event up the channel pipeline. 78 …* Whether a subscriber has been provided. This is used to detect whether two subscribers are subsc… 85 private volatile Subscriber<? super T> subscriber; field in HandlerPublisher 96 * @param executor The executor to execute asynchronous events from the subscriber on. 116 * Override to handle when a subscriber cancels the subscription. [all …]
|
| /external/aws-sdk-java-v2/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/nrs/ |
| D | HandlerSubscriberBlackboxVerificationTest.java | 23 import org.reactivestreams.Subscriber; 43 public Subscriber<Long> createSubscriber() { in createSubscriber() 48 HandlerSubscriber<Long> subscriber = new HandlerSubscriber<>(channel.eventLoop(), 2, 4); in createSubscriber() local 49 channel.pipeline().replace(dummy, "subscriber", subscriber); in createSubscriber() 51 return new SubscriberWithChannel<>(channel, subscriber); in createSubscriber() 60 public void triggerRequest(Subscriber<? super Long> subscriber) { in triggerRequest() argument 61 EmbeddedChannel channel = ((SubscriberWithChannel) subscriber).channel; in triggerRequest() 71 …* Delegate subscriber that makes the embedded channel available so we can talk to it to trigger a … 73 private static class SubscriberWithChannel<T> implements Subscriber<T> { 75 final HandlerSubscriber<T> subscriber; field in HandlerSubscriberBlackboxVerificationTest.SubscriberWithChannel [all …]
|
| /external/rust/crates/tracing-subscriber/src/ |
| D | util.rs | 10 /// Extension trait adding utility methods for subscriber initialization. 13 /// [default subscriber] more ergonomic. It is automatically implemented for all 15 /// implements `From<T>` for all `T: Subscriber`, all `Subscriber` 17 /// can be converted into `Subscriber`s, such as builders that construct a 18 /// `Subscriber`, may implement `Into<Dispatch>`, and will also receive an 21 /// [default subscriber]: https://docs.rs/tracing/0.1.21/tracing/dispatcher/index.html#setting-the-… 27 /// Sets `self` as the [default subscriber] in the current scope, returning a 31 /// a [`log`] compatibility layer. This allows the subscriber to consume 34 …/// [default subscriber]: https://docs.rs/tracing/0.1.21/tracing/dispatcher/index.html#setting-the… 45 /// Attempts to set `self` as the [global default subscriber] in the current [all …]
|
| /external/sdk-platform-java/gapic-generator-java/src/test/resources/ |
| D | pubsub_grpc_service_config.json | 104 "service": "google.pubsub.v1.Subscriber", 126 "service": "google.pubsub.v1.Subscriber", 130 "service": "google.pubsub.v1.Subscriber", 134 "service": "google.pubsub.v1.Subscriber", 138 "service": "google.pubsub.v1.Subscriber", 142 "service": "google.pubsub.v1.Subscriber", 146 "service": "google.pubsub.v1.Subscriber", 150 "service": "google.pubsub.v1.Subscriber", 154 "service": "google.pubsub.v1.Subscriber", 174 "service": "google.pubsub.v1.Subscriber", [all …]
|
| /external/rust/crates/tracing-subscriber/src/fmt/ |
| D | mod.rs | 1 //! A `Subscriber` for formatting and logging `tracing` data. 7 //! implementation of the [`Subscriber`] trait that records `tracing`'s `Event`s 16 //! tracing-subscriber = "0.3" 23 //! Add the following to your executable to initialize the default subscriber: 32 //! The default subscriber installed by `init` enables you to filter events 48 //! You can configure a subscriber instead of using the defaults with 51 //! ### Subscriber 57 //! let subscriber = tracing_subscriber::fmt() 67 //! The output format used by the layer and subscriber in this module is 119 //! // Create a `fmt` subscriber that uses our custom event format, and set it [all …]
|
| /external/aws-sdk-java-v2/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ |
| D | EmptyPublisher.java | 5 import org.reactivestreams.Subscriber; 11 public void subscribe(Subscriber<? super ByteBuffer> subscriber) { in subscribe() argument 12 subscriber.onSubscribe(new EmptySubscription(subscriber)); in subscribe() 21 private final Subscriber subscriber; field in EmptyPublisher.EmptySubscription 24 EmptySubscription(Subscriber subscriber) { in EmptySubscription() argument 25 this.subscriber = subscriber; in EmptySubscription() 33 … this.subscriber.onError(new IllegalArgumentException("Demand must be positive")); in request() 35 this.subscriber.onComplete(); in request()
|